mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-16 13:12:34 +00:00
Bug fixes: fixed crash with checkbox
This commit is contained in:
@@ -9,7 +9,7 @@ module CyberarmEngine
|
||||
@x, @y = x, y
|
||||
@checked = checked
|
||||
@size = size
|
||||
@text = Text.new("✔", false, x: x, y: y, size: size, color: BUTTON_TEXT_COLOR, shadow: true)
|
||||
@text = Text.new("✔", x: x, y: y, size: size, color: BUTTON_TEXT_COLOR, shadow: true)
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -55,8 +55,8 @@ module CyberarmEngine
|
||||
end
|
||||
|
||||
def mouse_over?
|
||||
if $window.mouse.x.between?(@x, @x+width)
|
||||
if $window.mouse.y.between?(@y, @y+height)
|
||||
if $window.mouse_x.between?(@x, @x+width)
|
||||
if $window.mouse_y.between?(@y, @y+height)
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -114,7 +114,7 @@ module CyberarmEngine
|
||||
end
|
||||
|
||||
# Fills container background with color
|
||||
def fill(color = Gosu::Color::BLACK, z = 0)
|
||||
def fill(color = Gosu::Color::BLACK, z = -1)
|
||||
$window.draw_rect(@x, @y, @width, @height, color, z)
|
||||
end
|
||||
|
||||
@@ -132,12 +132,12 @@ module CyberarmEngine
|
||||
|
||||
# Return X position relative to container
|
||||
def relative_x(int)
|
||||
int-self.x
|
||||
self.x+int
|
||||
end
|
||||
|
||||
# Return Y position relative to container
|
||||
def relative_y(int)
|
||||
int-self.y
|
||||
self.y+int
|
||||
end
|
||||
|
||||
def calc_percentage(positive, total)
|
||||
|
||||
Reference in New Issue
Block a user