Jump to content


Photo

iOS GML Functions


  • This topic is locked This topic is locked
7 replies to this topic

#1 Aragon1029

Aragon1029

    GMC Member

  • New Member
  • 940 posts

Posted 15 December 2010 - 09:59 PM

So, I know iOS development is a pretty hot topic on the GMC and my friend and I needed to have the official list of functions that the iOS runner (iPhone, iTouch, iPad, etc) used. Officially, YYG hasn't come out and told the public what these functions are, just that they'll deal with it when you send in your game to them. For me this is unsettling simply because you have less control over how the code is handled.

So this led me to look through the iOS runner and I now have a list of the "in-house plugin" functions (as stated by the iOS Baseline Spec)

They follow as:

YoYo_AddVirtualKey(x, y, width, height, keycode)
Sets a rectangle on the screen at a specific x and y with a specific width and height that emulates a keypress. keycode is set with ord() or vk_*.
Returns: A handle to the key

YoYo_DeleteVirtualKey(Handle)
Deletes a virtual key handle, removing its function from the screen.
Returns: True?

YoYo_ShowVirtualKey(<Handle?>)
Shows a virtual key
Returns: True?

YoYo_HideVirtualKey(<Handle?>)
Hides a virtual key
Returns: True?

YoYo_LoginAchievements()
Attempts to login to Apple's Game Center?
Returns: Success?

YoYo_LogoutAchievements()
Logs out of Apple's Game Center?
Returns: True?

YoYo_PostAchievement(Name, Value)
Posts an achievement to the Game Center?
Returns: Success?

YoYo_PostScore(Name, Value)
Posts a score to the Game Center?
Returns: Success?

YoYo_AchievementsAvailable()
Returns: If login information for the Game Center is available?

YoYo_OpenURL(URL)
Opens iOS's default browser to a destination?
Returns: Success?


Download GMK: http://www.x2048.com...OSFunctions.gmk

This will allow anyone planning on developing games for iOS devices to test their game more accurately on the PC/Mac.

Note: The Game Center specific functions all return false, as there's no point to emulate them on the PC/Mac. I may update this to have it store the values in a DB of some sort for pseudo support.

Cheers, Zach.

Edited by Aragon1029, 15 December 2010 - 10:13 PM.

  • 2

#2 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 15 December 2010 - 10:04 PM

wat.
  • 2

#3 Davve

Davve

    Procrastinator

  • GMC Member
  • 3665 posts
  • Version:GM8.1

Posted 15 December 2010 - 10:31 PM

/*
 *  YoYo_LogoutAchievements();
 *  Logs out of the users Apple Game Center's account
 */

return false;
/*
 *  YoYo_PostAchievement(<[String] Name>, <[Real] Value>);
 *  Posts an achievement
 */

return false;
/*
 *  YoYo_PostScore(<[String] Name>, <[Real] Value>);
 *  Posts a score
 */

return false;

Uselessness.
  • 0

#4 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 15 December 2010 - 10:47 PM

Uselessness.

The point of this is to make it easy to test your games before you port them to iOS. The scripts are empty so you don't run into compile errors when you try to run the game.

Edited by amd42, 15 December 2010 - 10:47 PM.

  • 0

#5 Aragon1029

Aragon1029

    GMC Member

  • New Member
  • 940 posts

Posted 15 December 2010 - 10:55 PM


Uselessness.

The point of this is to make it easy to test your games before you port them to iOS. The scripts are empty so you don't run into compile errors when you try to run the game.

Exactly, YYG just removes the scripts when they're ready to compile it for iOS.
Although I know those script will actually cause issues, so I need to fix them.
For now just change "return false" to "return true".
  • 0

#6 scream681

scream681

    Nick Larin

  • New Member
  • 1152 posts

Posted 18 December 2010 - 12:41 AM

Great Job, this will surely help a lot of people!

Edited by scream681, 18 December 2010 - 12:42 AM.

  • 0

#7 Adequate

Adequate

    GMC Member

  • GMC Member
  • 474 posts

Posted 05 January 2011 - 10:26 AM

Good find.
  • 0

#8 FredFredrickson

FredFredrickson

    Artist

  • Global Moderators
  • 9196 posts
  • Version:GM8

Posted 05 January 2011 - 06:24 PM

Unfortunately, we cannot allow projects here that are the direct result of deconstructing other people's games, or taking apart the iOS (or any version) runner.

I know this information would be helpful for some people, but YYG will release information you need if they see fit. I also very much doubt that they are going to receive your game submission warmly if they open up the code to find that you're using commands you've obtained by ripping apart the games they've already released.

Please do not post anything more like this again without checking with me first. PM me if you'd like to discuss it.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users