Windows Phone 8...?

Monkey Targets Forums/Windows 8/Windows Phone 8...?

SLotman(Posted 2013) [#1]
How do I know if I'm running on Windows 8, or Windows Phone 8? I know TARGET="win8", but how do I know it's the phone?

I ask, because I want to hide my mouse cursor on the phone - but not on "win8 desktop". What would be the best solution to this?


Xaron(Posted 2013) [#2]
That's easy. You don't have a mouse pointer on the phone at all. ;)


SLotman(Posted 2013) [#3]
No, I draw a mouse pointer myself!

I need to know if I'm on the phone or not, so I won't draw my "custom pointer" in the game.


Xaron(Posted 2013) [#4]
Well I use some #ifdef code (oh well how's that in Monkey? #If target="...") to make these platform specific stuff to compile or not.

So you could do:

#If TARGET_NAME = "Windows 8 Game"
  'Draw your mouse pointer
#End


The target names can be found in the target.monkey files in the targets folders.

"Windows 8 Game" is for Windows 8 apps.
"Windows Phone 8 Game" is for Windows 8 phone apps.

Or do you want to make the decision during runtime? Don't know about that in this case. Does that even work to build cross platform windows stuff which runs on the desktop AND phones?


SLotman(Posted 2013) [#5]
Oh, that's handy! thanks!


SLotman(Posted 2013) [#6]
Urg... finally went to test this, and Monkey (v73) doesn't recognize TARGET_NAME :(


MikeHart(Posted 2013) [#7]
...