API function reference

Actor control functions

System control functions

Mouse input functions

void resChangeActorType( const char *actorName, int type )

Sets an actor's type that specifies how Resolutionary should handle the actor.

Parameters

Example call

resChangeActorType("Event Actor", RES_ACTOR_DYNAMIC); // Set current actor's type to dynamic

Back to top

void resChangeActorZLayer( const char *actorName, int zLayer )

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.

Parameters

Example call

resChangeActorZLayer("Event Actor", 1); // Set current actor's z layer to 1

Back to top

void resChangeActorParent( const char *actorName, const char *parentName )

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.

Parameters

Example call

resChangeActorParent("Event Actor", "view"); // Tell Resolutionary that current actor is parented to view

Back to top

void resStart( int originalWidth, int originalHeight )

Creates the Resolutionary system actors and initializes and starts the system.

Parameters

Example call

resStart(640, 480); // Start Resolutionary on a game that is built in 640 x 480 resolution

Back to top

void resQuit( void );

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.

Example call

resQuit(); // Quit Resolutionary

Back to top

void resSetBackgroundColor( int rValue, int gValue, int bValue )

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.

Parameters

Example call

resSetBackgroundColor(128, 128, 128); // Make background gray

Back to top

void resSetBorderColor( int rValue, int gValue, int bValue )

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.

Parameters

Example call

resSetBorderColor(0, 0, 0); // Make borders black

Back to top

void resRequestStaticLayerUpdate( void );

Tells Resolutionary to redraw the static layer.

Example call

resRequestStaticLayerUpdate(); // Tell Resolutionary to update static layer

Back to top

int resOnMouseClick( enum resMouseButtonsEnum mButtonNumber )

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.

Parameters

Return value

1 if this actor was just clicked, 0 if not

Example call

// 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
}

Back to top

int resOnMouseRelease( enum resMouseButtonsEnum mButtonNumber )

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.

Parameters

Return value

1 if mouse button was just released on this actor, 0 if not

Example call

// 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
}

Back to top

int resOnMouseButtonDown( enum resMouseButtonsEnum mButtonNumber )

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.

Parameters

Return value

1 if mouse button was just pressed down, 0 if not

Example call

// 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
}

Back to top

int resOnMouseButtonUp( enum resMouseButtonsEnum mButtonNumber )

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.

Parameters

Return value

1 if mouse button was just released, 0 if not

Example call

// 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
}

Back to top

int resIsMouseButtonDown( enum resMouseButtonsEnum mButtonNumber )

Checks if a specified mouse button is down.

Parameters

Return value

1 if mouse button is down, 0 if not

Example call

if (resIsMouseButtonDown(RES_MOUSE_LEFT)) // If the left mouse button is down
{
    // Code for what should happen if left mouse button is down
}

Back to top

int resIsMouseButtonUp( enum resMouseButtonsEnum mButtonNumber )

Checks if a specified mouse button is up.

Parameters

Return value

1 if mouse button is up, 0 if not

Example call

if (resIsMouseButtonUp(RES_MOUSE_LEFT)) // If the left mouse button is up
{
    // Code for what should happen if left mouse button is up
}

Back to top

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.