8-2-2025 @ 3:51 AM
This commit is contained in:
31
Gameplay/BallSprite.cs
Normal file
31
Gameplay/BallSprite.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class BallSprite : Area2D
|
||||
{
|
||||
public bool _active = false, _hovered = false, _held = false;
|
||||
public int _ownerId;
|
||||
public string _imagePath;
|
||||
public Vector2 _rackPosition = new Vector2(0, 0);
|
||||
public void SetSprite(string PATH)
|
||||
{
|
||||
_imagePath = PATH;
|
||||
GetNode<Sprite2D>("Image").Texture = GD.Load<Texture2D>(PATH);
|
||||
}
|
||||
|
||||
private void OnMouseEntered()
|
||||
{
|
||||
if (_active)
|
||||
{
|
||||
_hovered = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnMouseExited()
|
||||
{
|
||||
if (_active)
|
||||
{
|
||||
_hovered = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user