forked from mmagrilov/DynRes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
60 lines (15 loc) · 782 Bytes
/
main.lua
File metadata and controls
60 lines (15 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
----------------------------------------------
-- DynResManager test --
----------------------------------------------
local myImageLoader = require "DynResManager"
-- 1) background: its dimensions ensure that "letterbox" margins are filled on known devices
local background = display.newRect(0, 0, 380, 570)
background.x = display.contentWidth * 0.5
background.y = display.contentHeight * 0.5
background:setFillColor( 240, 220, 210 )
-- 2) Loading a picture (lo-res "Pic.jpg" or hi-res "Pic@2x.jpg" depending on device resolution
pic = myImageLoader.loadImage("Pic.jpg")
pic.x = display.contentWidth * 0.5
pic.y = display.contentHeight * 0.35
print ("pic.xScale "..pic.xScale)
print ("pic.yScale "..pic.yScale)