elsassph / nme-tilelayer

Lightweight wrapper over NME's powerful but lowlevel 'drawTiles', with bitmap-based fallback for Flash.
92 stars 11 forks source link

[Feature Request] TileClip - alpha ? #7

Closed FlashTang closed 11 years ago

FlashTang commented 11 years ago

Hi Philippe

set the alpha of the TileClip , got an error

Source/InGame.hx:622: characters 5-23 : Float should be Int

( I‘m trying to fade an animated clip , there are no much clips ,so I think the performance wouldn't be a problem )

I checked the nme-tilelayer homepage , there is alpha propertie available for TileSprite But unfortunately , there is no alpha propertie on TileClip I really hope the dev can add alpha for TileClip ,cuz it's useful ,if it's poosible ?

Many thanks

Tang

FlashTang commented 11 years ago

Oh , wait

It works :)

Seems there is an issue in "get and set function" of TileClip or TileSprite ?

alpha returns an Int instead of Float

You can't set the alpha like such

ani.alpha-=0.05;

But you can set the like such :)

var a:Float=ani.alpha; ani.alpha=a-0.05;

Cheers

Tang

elsassph commented 11 years ago

TileSprite.alpha is a public Float var, and I can't reproduce your problem - are you sure the problem isn't on your side?