Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Question about smooth zoom/scale object
Started by grifon903 May 03 2019 11:03 AM

2 replies to this topic

Best Answer roaminggamer , 03 May 2019 - 11:04 PM

Ditto.

local obj = display.newCircle( 100, 100, 10 )

transition.to( obj, { xScale = 2, yScale = 2, time = 5000 } )

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

grifon903

[GLOBAL: userInfoPane.html]
grifon903
  • Observer

  • 8 posts
  • Corona SDK

Hello. 

 

I want make scale my object when it move.

I know about object.scale(), but using this method I get instant results, and I need a change (for example, an increase in the object) to occur in real time, "before my eyes"

How can I achieve this?



[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 758 posts
  • Corona SDK

You probably want to use transitions (see https://docs.coronalabs.com/api/library/transition/to.html).

You can use transition.to and pass xScale and yScale as references to scale the display object over time.


  • roaminggamer and sporkfin like this

[TOPIC: post.html]
#3

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,585 posts
  • Corona SDK

  Best Answer

Ditto.

local obj = display.newCircle( 100, 100, 10 )

transition.to( obj, { xScale = 2, yScale = 2, time = 5000 } )



[topic_controls]
[/topic_controls]