Anim Editor: added FoeFlip property, Space to play, S to swap sides, P to show/hide property lines for selected particle

This commit is contained in:
Maruno17
2024-04-18 22:35:15 +01:00
parent 15033d6114
commit 4480def33c
23 changed files with 264 additions and 161 deletions

View File

@@ -24,6 +24,8 @@ class UIControls::BaseControl < BitmapSprite
invalidate
end
#-----------------------------------------------------------------------------
def width
return self.bitmap.width
end
@@ -32,6 +34,8 @@ class UIControls::BaseControl < BitmapSprite
return self.bitmap.height
end
#-----------------------------------------------------------------------------
def mouse_pos
mouse_coords = Mouse.getMousePos
return nil, nil if !mouse_coords
@@ -40,10 +44,6 @@ class UIControls::BaseControl < BitmapSprite
return ret_x, ret_y
end
def set_interactive_rects
@interactions = {}
end
def mouse_in_control?
return false if !@interactions || @interactions.empty?
mouse_x, mouse_y = mouse_pos
@@ -51,8 +51,6 @@ class UIControls::BaseControl < BitmapSprite
return @interactions.any? { |area, rect| rect.contains?(mouse_x, mouse_y) }
end
#-----------------------------------------------------------------------------
def disabled?
return @disabled
end
@@ -102,6 +100,12 @@ class UIControls::BaseControl < BitmapSprite
#-----------------------------------------------------------------------------
def set_interactive_rects
@interactions = {}
end
#-----------------------------------------------------------------------------
def draw_text(this_bitmap, text_x, text_y, this_text)
text_size = this_bitmap.text_size(this_text)
this_bitmap.draw_text(text_x, text_y, text_size.width, text_size.height, this_text, 0)