Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Large image width question
Started by gernest123 Aug 07 2016 01:18 PM

1 reply to this topic
width display object contentwidth scale
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

gernest123

[GLOBAL: userInfoPane.html]
gernest123
  • Observer

  • 6 posts
  • Enterprise

We're making a find Waldo type of game.  In one example the background image is very large, i.e.  2412x1624.  When I try and retrieve the width or height of the display object using width or contentWidth it is not giving me the expected 2412x1624, but instead is giving me 1520x1024 (when testing on iPhone6 landscape).  The scale in the config.lua is letterbox.  Is there a way to get the original image dimensions?

 

Thanks,

Greg



[TOPIC: post.html]
#2

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,821 posts
  • Enterprise

try this

obj.xscale, obj.yscale = .5,.5

local objHeight, objWidth = obj.height*2, obj.width*2

obj.xscale, obj.yscale = 1,1


[topic_controls]
[/topic_controls]