|
Graphics
~~~~~~~~~~~
General
Initialize ([width], [height],[windowed])
Terminate
Clear([color]) -- default is black
Display -- draws all graphics that have been
set to the buffer to the visible screen
SetTitle(title) -- sets the text in the caption
of a windowed display
SetIcon(filename) -- sets the icon in the
caption of a windowed display
CreateFont(FontName, size, [Bold], [Italic],
[Underline]) - returns a font index to the font
created
SetText(text, x, y, Font, [Red], [Green],
[Blue], [Alpha]) - draws text at x, y using Font
index to the buffer
Screenshot(Filename) -- from a FullScreen
display, save a screenshot to the specified
Filename
FPS -- returns the Frames per Second
Image
Loadimage(filename, [colorkey]) -- loads a
graphic image from a file, returns its image
index
Cloneimage(image) -- duplicate a previously
loaded image, this saves memory
SetImage(image) -- draws the image to the
buffer
SetVisible(image,x) -- default is true
SetX(image,x) -- positions the image in the
x-axis
SetY(image,Y) -- positions the image in the
y-axis
SetXY(image, X, Y) --
SetR(image, Red) -- sets the images color RED
value
SetG(image, Green) -- sets the images color
Green value
SetB(image, Blue) -- sets the images color Blue
value
SetAngle(image, radians) -- sets the image
rotation
SetAlpha(image, alpha) -- sets the image
transparency
SetScaleX(image, scalex) -- sets the size
(stretch or shrink) in the x-axis, negative
numbers flip it
SetScaleY(image, scaley) -- sets the size
(stretch or shrink) in the y-axis, negative
numbers flip it
SetRows(image, rows) -- number of rows in an
image strip
SetCols(image, columns) -- number of columns in
an image strip
SetTotalFrames(image, totalframes) -- number of
images in an image strip (because it is not always
rows*cols)
SetCurrentFrame(image, currentFrame) -- current
image in the image strip
SetAnimated(image, True or False) -- enable
animated image strip
SetFrameHeight(image, frameheight) -- image
height in an image strip
SetFrameWidth(image, framewidth) -- image width
in an image strip
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
System
~~~~~~
.
Pause(mseconds) -- waits so many
milliseconds
ProcessMessages --
DebugPrint --
GetWindowState -- returns 0 = normal, 1 =
minimized, 2 = maximized
GetTime -- returns time in ticks
File
ex. of filename = "C:\test.txt"
FileAppend(Filename, Text) --
FileCopy(Filename1, Filename2) -- returns 0 if
error
FileDelete(Filename) -- returns 0 if error
FileRead(Filename) -- returns data
FileWrite(Filename, Data) --
FileExists(Filename) -- returns 0 if not
exist
FileSize(Filename) -- returns value
Folder
ex. of Foldername = "C:\mydir"
FolderExists(Foldername) -- returns 0 if not
exist
FolderCreate(Foldername) --
FolderDelete(Foldername) -- returns 0 if
fail
INI
ex. of filename = "C:\test.ini"
ex. of section = "colors"
ex. of key = "background"
ex. of setting = "&hFFFFFFFF"
IniGetSetting(Filename, section, key) --
returns data
IniDelete(Filename) --
IniSaveSetting(Filename, section, key, setting)
-- n.b. Creates if does not already exist
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FX (particle
effects)
~~~~
loadimage(filename) -- loads the image of the
particle to use, returns an index to an FX
SetPArticles FXIndex, number of particles --
the FX and how many particle to use
SetXY FXIndex, x, y -- the FX index and the x
and y location of the FX
Initialize FXIndex, FXType
,size -- the FX index, the type of
FX (fire, thrust, smoke, rain, snow, explode, custom), size
of particle
SetFX FXIndex -- draws the FX to the back
buffer, place after graphics.clear
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Key
~~~
Initialize --
Terminate --
Pressed(keycode) --
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mouse
~~~~~
Initialize --
Terminate --
dX --
dY --
dZ --
LeftButton --
RightButton --
MiddleButton --
Update --
x --
y --
Hide --
Show --
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Music
this is for playing a .mid file
~~~~~
Initialize --
Terminate --
CurrentTimeTicks(musicID) -- returns current
ticks
CurrentTimeSeconds(musicID) -- returns
seconds
LoopPlay(musicID, True or False) --
StartPosition(musicId, tickcount) -- sets where
to start
PlayLengthTicks(musicID) --
PlayLengthSeconds(musicID) --
TempoModifier(value) -- sets the tempo
Tempo(musicID) -- gets the tempo
TimeSignature(musicID) --
playmidi(musicID) --
loadmidi(filename) -- returns the file's
musicID
pausemidi(musicID) --
clearmidi(musicID) --
clearallmidi() --
stopmidi(musicID) --
GetVolume() -- returns value for all midi's
SetVolume(value) -- sets the volume for all
midi's
~~~~~~~~below is for MP3 files
~~~~~~~~~~~~~~~~~~~
LoadMP3(FileName)
PauseMP3()
PlayMP3()
SetMP3Balance(Value)
SetMP3Speed(Value)
SetMP3Volume(Value)
StopMP3()
TerminateMP3()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sound
this is for .wav files
~~~~~
Initialize --
Terminate --
LoadWav filename -- returns index to sound
PlayWav index --
StopWav index --
PauseWav index --
clearWav index -- frees the memory of that
sound
clearallWav() -- frees memory of all loaded
sounds
SetvolumeWav index, volume% --
GetvolumeWav(index) -- returns value
GetStatus(index) -- returns "Looping",
"Playing", or "Buffer Lost"
GetFrequency(index) -- returns value
SetFrequency index, value -- try values from
2000 to 20000 for fun
Getposition(index) -- returns the current
playing position
Setposition index, value -- sets the current
playing position
Getpan(index) -- returns the current pan value,
default = 0 which is centered
Setpan index, value -- sets the current pan
value
SetLoopPlay index, value - value = True cause
indexed wav to continuously play |