mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-16 21:22:33 +00:00
Bug fixes: fixed crash with checkbox
This commit is contained in:
@@ -9,7 +9,7 @@ module CyberarmEngine
|
|||||||
@x, @y = x, y
|
@x, @y = x, y
|
||||||
@checked = checked
|
@checked = checked
|
||||||
@size = size
|
@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
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -55,8 +55,8 @@ module CyberarmEngine
|
|||||||
end
|
end
|
||||||
|
|
||||||
def mouse_over?
|
def mouse_over?
|
||||||
if $window.mouse.x.between?(@x, @x+width)
|
if $window.mouse_x.between?(@x, @x+width)
|
||||||
if $window.mouse.y.between?(@y, @y+height)
|
if $window.mouse_y.between?(@y, @y+height)
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ module CyberarmEngine
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Fills container background with color
|
# 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)
|
$window.draw_rect(@x, @y, @width, @height, color, z)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -132,12 +132,12 @@ module CyberarmEngine
|
|||||||
|
|
||||||
# Return X position relative to container
|
# Return X position relative to container
|
||||||
def relative_x(int)
|
def relative_x(int)
|
||||||
int-self.x
|
self.x+int
|
||||||
end
|
end
|
||||||
|
|
||||||
# Return Y position relative to container
|
# Return Y position relative to container
|
||||||
def relative_y(int)
|
def relative_y(int)
|
||||||
int-self.y
|
self.y+int
|
||||||
end
|
end
|
||||||
|
|
||||||
def calc_percentage(positive, total)
|
def calc_percentage(positive, total)
|
||||||
|
|||||||
Reference in New Issue
Block a user