in4ray / firefly-sdk

Firefly - in4ray Gaming SDK
http://firefly.in4ray.com
Other
54 stars 11 forks source link

Flash based components don't support pivots. #9

Closed dbathily closed 11 years ago

dbathily commented 11 years ago

I have this error with the master branch when i try to add a label in a sprite

AIR 3.6 and or 3.7 Starling 1.3

Thanks

Error: Flash based components don't support pivots.
    at com.in4ray.gaming.components.flash::TextField/setActualPivots()[/Users/bathily/Developpement/oss/firefly-sdk/firefly/src/com/in4ray/gaming/components/flash/TextField.as:213]
    at com.in4ray.gaming.layouts::LayoutTarget/apply()[/Users/bathily/Developpement/oss/firefly-sdk/firefly/src/com/in4ray/gaming/layouts/LayoutTarget.as:58]
    at com.in4ray.gaming.layouts::LayoutManager/layout()[/Users/bathily/Developpement/oss/firefly-sdk/firefly/src/com/in4ray/gaming/layouts/LayoutManager.as:54]
    at com.in4ray.gaming.components.flash::TextField/layout()[/Users/bathily/Developpement/oss/firefly-sdk/firefly/src/com/in4ray/gaming/components/flash/TextField.as:139]
    at com.in4ray.gaming.components.flash::Sprite/addElement()[/Users/bathily/Developpement/oss/firefly-sdk/firefly/src/com/in4ray/gaming/components/flash/Sprite.as:192]
    at fr.njin.iland.splash::CompanySplash/createChildren()[/Users/bathily/Developpement/iland/mobile/src/fr/njin/iland/splash/CompanySplash.as:28]
    at com.in4ray.gaming.components.flash::Sprite/addedToStageHandler()[/Users/bathily/Developpement/oss/firefly-sdk/firefly/src/com/in4ray/gaming/components/flash/Sprite.as:44]
    at flash.display::DisplayObjectContainer/addChild()
    at com.in4ray.gaming.components.flash::Sprite/addElement()[/Users/bathily/Developpement/oss/firefly-sdk/firefly/src/com/in4ray/gaming/components/flash/Sprite.as:188]
    at com.in4ray.gaming.components.flash::GameApplication/showNextSplash()[/Users/bathily/Developpement/oss/firefly-sdk/firefly/src/com/in4ray/gaming/components/flash/GameApplication.as:244]
    at com.in4ray.gaming.components.flash::GameApplication/addedHandler()[/Users/bathily/Developpement/oss/firefly-sdk/firefly/src/com/in4ray/gaming/components/flash/GameApplication.as:201]
vstyran commented 11 years ago

For now you can't use $pivotX() and $pivotY() layouts for Flash based components only for Starling based.

dbathily commented 11 years ago

I didn't use $pivot. I just follow one of your tutorial.

var logo:TextField = new TextField();
logo.text = "Logo Splash";
logo.setTextFormat(new TextFormat(null, 30));
addElement(logo/*, $hCenter(0), $vCenter(0), $vRatio(50).pct*/);
dbathily commented 11 years ago

I think I found the problem. At line 58 of LayoutTarget, there is a call to setActualPivots that don't care of the component https://github.com/in4ray/firefly-sdk/blob/master/firefly/src/com/in4ray/gaming/layouts/LayoutTarget.as#L58

vstyran commented 11 years ago

Hi, thanks. I see the issue will try to fix soon.