如何在corona sdk中移动物体透明度时如何更改物体透明度?
答
可以使用alpha
和transition
实现这一尝试下面的代码,它应该工作..下面的代码改变平方超过1.5秒的一段时间0至100% uare透明度,同时移动
display.setDefault("background", 80/255)
local square = display.newRect( 0, display.contentHeight/2, 100, 100)
square.anchorChildren = true
square:setFillColor(255,255,0)
square.alpha = 0
local w,h = display.contentWidth, display.contentHeight
transition.moveTo(square, { x = w/2, y = h/2, time=1500 , alpha = 1.0})
那你至今呢?用于显示对象的不透明度['alpha'](https://docs.coronalabs.com/api/type/DisplayObject/alpha.html)属性。 – ldurniat