DaVikingCode / Citrus-Engine

Modern AS3 Game Engine
http://citrusengine.com/
Other
549 stars 231 forks source link

Accessing undefined properties starling.contentScaleFactor #299

Closed IvanChen008 closed 7 years ago

IvanChen008 commented 7 years ago

src>citrus>core>starling>StarlingCitrusEngine.as 128 line var scaleF:Number = Math.floor(starling.contentScaleFactor * 1000) / 1000;

gsynuh commented 7 years ago

@hewenyuann19930327 what version of citrus engine are you using? and when does this happen?

IvanChen008 commented 7 years ago

the lastest version(3.2 CitrusEngine) when i was trying those examples , starling.contentScaleFactor seems to be a private property is invisible so I can't access it.(in the Starling 2.1 version);

gsynuh commented 7 years ago

I have no recollection of contentScaleFactor ever being private

here it is : https://github.com/Gamua/Starling-Framework/blob/62834683211b7928448e75c6ac6d02cac220e183/starling/src/starling/core/Starling.as#L806

And it's always been public since it's been introduced in StarlingCitrusEngine.as

So either there's something wrong with the starling 2.1 swc you're using, or something in your setup, or something even more obscure (probably that), but to be sure can you try using the latest starling source code (that's what I'm using right now and everything's ok) and tell me if it still happens?

IvanChen008 commented 7 years ago

Thanks for your help.i ‘ll try the lastest version of the starling. then i'll tell you the result

IvanChen008 commented 7 years ago

the starling should be modified to _starling, my IDE read to the starling package is not a Starling instance, so can not access to the contentScaleFactor property。

IvanChen008 commented 7 years ago

Sorry my flashBuilder4.6 bug, this starling conflict with the starling package, and he thinks starling is a package can not detect starling getter. I changed the IDE to solve this problem.

gsynuh commented 7 years ago

you're right, it should be _starling though. I'll change that. oh and thanks for your pull requests, I removed "name" from the arguments since now we want a one argument constructor with only params --- simply because really a name is not interesting to have in most cases and when it is, it can be passed in params anyway.