DaVikingCode / Citrus-Engine

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

Fixed and Improved Platform.as 31/05/2017 #284

Closed Snky closed 1 year ago

Snky commented 8 years ago

Added isFullscreen() Fixed/Improved isLandscape() Changed all uses of .fullscreenWidth to .stageWidth; Changed all uses of .fullscreenHeight to .stageHeight;

Now accommodates for all three possible orientations: portrait, landscape, width==height(any?) Now accommodates for all three possible stage.displayState(s)

gsynuh commented 7 years ago

@Snky If I merge this, what do you think about this whole thing being renamed something like ApplicationPlatform or something , it seems a bit more explicit and seperate from platform objects, what do you think?

Also why not get that merged with Mobile.as , I only use Mobile.as like once a year, never found use for Platform, but I don't see why we have two things for the purposes of guessing our current platform, the runtime, and orientation and so on.

alamboley commented 7 years ago

Just saw Starling have some nice methods https://github.com/Gamua/Starling-Framework/blob/master/starling/src/starling/utils/SystemUtil.as

Snky commented 7 years ago

Hey guys, I missed the notifications for your replies (sorry for the late reply), I don't mind how you guys want to go about it, use the class as you please, I'm going to continue working on Platform.as and Platform.hx for myself, so if you think a different name is better, or a merge, go ahead!

If you want to still receive new pull requests, I can do that (and do the renaming on your behalf to suit CE). If you want to go about providing this feature for your developers differently, I don't mind that either.

Regarding merging, I think there is a closed issue perhaps, that me and Aymeric discussed and thought Platform was a better name than Mobile, as it contains information related to browsers and desktop platforms, not just phone devices.

Found the reference to the class name choice: #226

Snky commented 7 years ago

Added isFullscreen() Fixed/Improved isLandscape() Changed all uses of .fullscreenWidth to .stageWidth; Changed all uses of .fullscreenHeight to .stageHeight;

Now accommodates for all three possible orientations: portrait, landscape, width==height(any?) Now accommodates for all three possible stage.displayState(s)

On top of these changes that were not pushed to CE in July 2016, I have:

+Added a check for OpenFL as a runner (more of an addition to my Haxe Platform.hx) +Added a check for Blackberry +Added isMobile() +Merged iPhoneFive with iPhoneSE -> function name: isIphoneFiveSE() +Merged iPhoneSix with iPhoneSeven -> function name: isIphoneSixSeven() +Merged iPhoneSixPlus with iPhoneSevenPlus -> function name: isIphoneSixSevenPlus() (These devices share the same resolution, so for now they will share the same functions)

Code refactor / format as you please, and rename the class to whatever suits your community. (31/05/2017 commit ref: https://github.com/DaVikingCode/Citrus-Engine/pull/284/commits/35846361e2d7adaaa75b68db75f1154c3c7fe037)