LuaZM Reference

From WikiPrizm
Revision as of 01:10, 21 August 2012 by KermMartian (talk | contribs) (Created page with "== ZMG Library == All functions in the ZMG ("Pri'''ZM''' '''G'''raphics) library are invoked with zmg.''function''(''arguments,...''). The functions with filled-in details and...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

ZMG Library

All functions in the ZMG ("PriZM Graphics) library are invoked with zmg.function(arguments,...). The functions with filled-in details and arguments have been implemented, but most are untested. Functions without details are unimplemented. They are as follows:

zmg.clear()

zmg.clear()

Clears the VRAM buffer. No arguments, no return value.

zmg.xorsprite()

zmg.xorsprite(x,y,width,height,data)

XORs the given sprite to the VRAM buffer. Does not perform clipping.

x: (number) x-coordinate of left edge of sprite
y: (number) y-coordinate of top edge of sprite
width: (number) width of sprite in pixels
height: (number) height of sprite in pixels
data: (string) hex for sprite. 4 hex characters per pixel, 5-6-5 color

zmg.copysprite()

zmg.copysprite(x,y,width,height,data)

Copies the sprite to the VRAM buffer, overwriting any existing contents. Does not perform clipping.

x: (number) x-coordinate of left edge of sprite
y: (number) y-coordinate of top edge of sprite
width: (number) width of sprite in pixels
height: (number) height of sprite in pixels
data: (string) hex for sprite. 4 hex characters per pixel, 5-6-5 color

zmg.drawline()

zmg.drawpoint()

zmg.drawrect()

zmg.drawrectfilled()

zmg.copyspritemask()

zmg.fastcopy()

zmg.fastcopy()

Copy the VRAM to the LCD. Takes no arguments, has no return value.

zmg.drawcircle()

zmg.drawcircle(x,y,radius,color)

Draws an unfilled circle centered at (x,y) with radius radius and line color color.

x: (number) x-coordinate of center of circle. Must be onscreen.
y: (number) y-coordinate of center of circle. Must be onscreen.
radius: (number) radius of circle. May put some portions of circle offscreen.
color: (number) A color, such as 0xF500. Not a string. Planned: zmg.nametocolor("red") function.

zmg.fastkeymenu()

zmg.fastkeymenu()

Get a keypress, and handle the [MENU] key if pressed. This is non-blocking, and returns zero if no key is pressed. Takes no arguments, returns a number.