Scrupp SVN Manual
Create your own 2D games and applications

General Functions

Version

scrupp.VERSION
This variable contains a string with the version of Scrupp. The format is major.minor.

Platform

scrupp.PLATFORM
Contains a string describing the platform Scrupp was compiled on. Can be one of "Windows", "Mac OS X", "Linux" and "Unknown".

General functions

scrupp.init(title, width, height, bit_depth, fullscreen, [resizable])
Creates a window with the chosen title, a size in pixel chosen by width and height and the chosen bit_depth. The fullscreen parameter toggles between fullscreen (true) or window mode (false). If window mode is selected, the optional boolean parameter resizable enables or disables the resizing of the window.
scrupp.getWindowWidth()
Has to be called after scrupp.init(). Returns the window width in pixels.
scrupp.getWindowHeight()
Has to be called after scrupp.init(). Returns the window height in pixels.
scrupp.getWindowSize()
Has to be called after scrupp.init(). Returns the window width and height in pixels.
scrupp.getTicks()
Has to be called after scrupp.init(). Returns the number of milliseconds since the start of the application.
scrupp.setDelta(delta)
Sets the minimum delta in milliseconds between two frames. If delta equals 0, Scrupp runs as fast as possible.
scrupp.showCursor([show])
If called without argument, returns the current state of the cursor as boolean. Otherwise the state of the cursor is changed depending on the boolean argument show.
scrupp.exit()
A call to this function immediately exits the application.

Modifications of the render state

The following set of functions modify the render state of Scrupp. That means, they change the way everything is rendered afterwards. This applies to the rendering of images, movies and drawings.

It's important to know, that the three functions to translate, scale and rotate the view influence each other depending on the order in which they are executed. The recommended order that usually does what you want is:

  1. scrupp.translateView()
  2. scrupp.rotateView()
  3. scrupp.scaleView()
scrupp.translateView(x, y)
Moves the view by the specified number of pixels in x and y direction.
This function wraps the OpenGL function glTranslate.
scrupp.scaleView(sx, sy)
Scales the view by the specified factor sx in x and sy in y direction.
This function wraps the OpenGL function glScale.
scrupp.rotateView(angle)
Rotates the view by the specified angle in degrees. Positive values rotate clockwise, negative ones counter-clockwise.
This function wraps the OpenGL function glRotate.
scrupp.saveView()
Saves the current view. Can be called multiple times. Every time the view is saved on a stack. The view on the top of the stack can be restored using scrupp.restoreView().
This function wraps the OpenGL function glPushMatrix.
scrupp.restoreView()
Restores the view that was saved most recently with scrupp.saveView(). Then this view is removed from the stack of saved views.
This function wraps the OpenGL function glPopMatrix.
scrupp.resetView()
Replaces the current view with the default one.
This function wraps the OpenGL function glLoadIdentity.

Hosted by
SourceForge.net Logo

Valid XHTML 1.0!

Last modified Sat Sep 05, 2009