Sets an actor's type that specifies how Resolutionary should handle the actor.
resChangeActorType("Event Actor", RES_ACTOR_DYNAMIC); // Set current actor's type to dynamic
Sets an actor's z layer. Actors are drawn in order by their z layer, from lowest to highest. So, actors with a higher z layer will be drawn on top of the actors with a lower z layer. The number of an actor's z layer can be positive or negative.
resChangeActorZLayer("Event Actor", 1); // Set current actor's z layer to 1
Tells Resolutionary that an actor has a parent
Important
Remember to always use this function together with Game Editor's ChangeParent();
function if the parented actor is to be drawn by Resolutionary. If the system isn't notified of the change in the actor's parenting, the actor will be drawn in a wrong position.
resChangeActorParent("Event Actor", "view"); // Tell Resolutionary that current actor is parented to view
Creates the Resolutionary system actors and initializes and starts the system.
resStart(640, 480); // Start Resolutionary on a game that is built in 640 x 480 resolution
Quits the Resolutionary system's execution, destroys all Resolutionary system actors and frees all allocated memory.
Important
Resolutionary uses dynamic memory allocation for storing the actor lists. Normally, all memory that a process has allocated is freed when the process ends (i.e. the program or game is closed). But in Game Editor, when you're testing your game in Game Mode, exiting the Game Mode doesn't free the memory allocated by the user's code - instead, it stays allocated, creating a memory leak.
As you enter and exit Game Mode repeatedly, Game Editor's memory consumption continues to rise. To avoid this, make sure to always call resQuit();
before exiting Game Mode. Possibly the easiest way to do this is to add a Key Down event calling resQuit();
and then adding a Key Up event for the same key, calling ExitGame();
to exit back to Editor Mode. Note that unfortunately you can't use the escape key for this, because escape is Game Editor's default exit key, and pressing it causes the game to exit instantly without processing any code placed in a Key Down event for the escape key.
resQuit(); // Quit Resolutionary
Sets the background color of the game, it might be desirable to set it to be the same as the project's background color in Config -> Game properties -> Game background color.
resSetBackgroundColor(128, 128, 128); // Make background gray
Sets the color of the borders that will be shown on the edges of the screen if the new resolution's aspect ratio is different from the original one's. Typically these borders are black and hence are sometimes referred to as "black bars".
Important
This function has to be called before calling resStart();
(i.e. before the borders are created) for the specified color to be applied on the borders.
resSetBorderColor(0, 0, 0); // Make borders black
Tells Resolutionary to redraw the static layer.
resRequestStaticLayerUpdate(); // Tell Resolutionary to update static layer
Checks if a specified mouse button was just pressed down on the actor calling this function. This function is meant to be used as a way to replicate Game Editor's default mouse click behavior where only the actor with the highest z depth at the cursor's position reacts to mouse input.
Important
Due to the way Resolutionary's mouse input works, this function can only be used in an Activation Event from resMouseClickDetector
.
1 if this actor was just clicked, 0 if not
// Actor -> Activation Event (resMouseClickDetector)
if (resOnMouseClick(RES_MOUSE_LEFT)) // If the left mouse button was just clicked on this actor
{
// Code for what should happen on left mouse button down event
}
Checks if a specified mouse button was just released on the actor calling this function. This function is meant to be used as a way to replicate Game Editor's default mouse click behavior where only the actor with the highest z depth at the cursor's position reacts to mouse input.
Important
Due to the way Resolutionary's mouse input works, this function can only be used in an Activation Event from resMouseClickDetector
.
1 if mouse button was just released on this actor, 0 if not
// Actor -> Activation Event (resMouseClickDetector)
if (resOnMouseRelease(RES_MOUSE_LEFT)) // If the left mouse button was just released on this actor
{
// Code for what should happen on left mouse button up event
}
Checks if a specified mouse button was just pressed down.
Important
Due to the way Resolutionary's mouse input works, this function can only be used in an Activation Event from resMouseClickDetector
.
1 if mouse button was just pressed down, 0 if not
// Actor -> Activation Event (resMouseClickDetector)
if (resOnMouseButtonDown(RES_MOUSE_LEFT)) // If the left mouse button was just pressed down
{
// Code for what should happen on left mouse button down event
}
Checks if a specified mouse button was just released.
Important
Due to the way Resolutionary's mouse input works, this function can only be used in an Activation Event from resMouseClickDetector
.
1 if mouse button was just released, 0 if not
// Actor -> Activation Event (resMouseClickDetector)
if (resOnMouseButtonUp(RES_MOUSE_LEFT)) // If the left mouse button was just released
{
// Code for what should happen on left mouse button up event
}
Checks if a specified mouse button is down.
1 if mouse button is down, 0 if not
if (resIsMouseButtonDown(RES_MOUSE_LEFT)) // If the left mouse button is down
{
// Code for what should happen if left mouse button is down
}
Checks if a specified mouse button is up.
1 if mouse button is up, 0 if not
if (resIsMouseButtonUp(RES_MOUSE_LEFT)) // If the left mouse button is up
{
// Code for what should happen if left mouse button is up
}
This site uses Google code-prettify for syntax highlighting. Prettify is distributed under the Apache 2.0 License and is Copyright (C) 2011 Google Inc.