[WIP] En l'scroll
This commit is contained in:
@@ -11,7 +11,7 @@ function viewport.new()
|
||||
position=viewport.position,
|
||||
print=viewport.print,
|
||||
room=viewport.coord2room,
|
||||
roomXY=viewport.room2coord }
|
||||
roomXY= viewport.room2coord }
|
||||
end
|
||||
|
||||
|
||||
@@ -29,20 +29,21 @@ function viewport:coord2room ()
|
||||
return calc_room
|
||||
end
|
||||
|
||||
function viewport:room2coord ( room )
|
||||
function viewport:room2coord ( _room )
|
||||
local tw = arcade_config.tiles_width
|
||||
local th = arcade_config.tiles_height
|
||||
local cols = mapa_room_cols
|
||||
local rows = mapa_room_rows
|
||||
local rooms_per_floor = mapa_rooms_per_piso
|
||||
|
||||
local x = (room % rooms_per_floor) * cols * tw
|
||||
local y = math.floor(room/rooms_per_floor) * rows * th
|
||||
local x = (_room % rooms_per_floor) * cols * tw
|
||||
local y = math.floor(_room/rooms_per_floor) * rows * th
|
||||
|
||||
local room_center_x_offset = (cols * tw) >> 1
|
||||
local room_center_y_offset = (rows * th) >> 1
|
||||
|
||||
return x+room_center_x_offset, y+room_center_y_offset
|
||||
-- return x+room_center_x_offset, y+room_center_y_offset
|
||||
return x, y
|
||||
end
|
||||
|
||||
function viewport:position(x, y)
|
||||
|
||||
Reference in New Issue
Block a user