Add better click through semantics
This commit is contained in:
@@ -69,15 +69,6 @@ world.spawn do |e| # Name is optional
|
||||
# c.tile[x: 0, y: 0] = tiles[0] # set tile at position x,y in tilemap to a specific tile from the sheet (if no auto_tile is used)
|
||||
c.tile[x: 0, y: 0] = true # true/false otherwise
|
||||
end
|
||||
e.add_component :render do |c|
|
||||
c.z_index = 0
|
||||
c.renderer = proc do
|
||||
draw_rect 0, 0, 50, 50, {r: 255, g: 0, b: 0, a: 255} # example of custom rendering code for this entity (0,0 is the position of the entity)
|
||||
draw_text "Hello World", default_font, 0, 0, {r: 255, g: 255, b: 255, a: 255}
|
||||
end
|
||||
# offset from the position of the entity, useful for things like speech bubbles or health bars that should be above the entity, etc
|
||||
c.offset = {x: 0, y: 0}
|
||||
end
|
||||
e.add_component :health do |c|
|
||||
c.health = 100
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user