Cacaus volant!
This commit is contained in:
@@ -13,7 +13,8 @@ function viewport.new()
|
||||
room=viewport.coord2room,
|
||||
roomXY= viewport.room2coord,
|
||||
tile= viewport.coord2tile,
|
||||
screen_coords = viewport.screen_coords }
|
||||
screen_coords = viewport.screen_coords,
|
||||
inside = viewport.inside }
|
||||
end
|
||||
|
||||
function viewport:screen_coords ( x, y )
|
||||
@@ -22,6 +23,12 @@ function viewport:screen_coords ( x, y )
|
||||
return scr_x, scr_y
|
||||
end
|
||||
|
||||
function viewport:inside( x, y )
|
||||
local result = false
|
||||
if x>=self.x and x<=self.x+self.width and y>=self.y and y<=self.y+self.height then result = true end
|
||||
return result
|
||||
end
|
||||
|
||||
function viewport:coord2tile ()
|
||||
local tw = arcade_config.tiles_width
|
||||
local th = arcade_config.tiles_height
|
||||
|
||||
Reference in New Issue
Block a user