Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Good day help with scaling to desired scale
Started by vonncc123 Feb 19 2020 08:51 PM

2 replies to this topic
size scale image sprites
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

vonncc123

[GLOBAL: userInfoPane.html]
vonncc123
  • Contributor

  • 238 posts
  • Corona SDK

Good day can anyone help me, I want to achieve this kind of image, when the image size is above the desired width, I want to change the scale of the image to fit the desired width.

 

below is a sample desired output. I want it to scale rather than change it's height and width.

 

1.) Over size image (red box) dPoZSd1.png

2. Scaled image to fit the desired size which is the screen itself

uJgap4E.png

 



[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,666 posts
  • Corona SDK

Just scale the object by the value screenWidth/objectWidth


  • XeduR @Spyric likes this

[TOPIC: post.html]
#3

vonncc123

[GLOBAL: userInfoPane.html]
vonncc123
  • Contributor

  • 238 posts
  • Corona SDK

Real thanks my dude! :)




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: size, scale, image, sprites