Zones

[ Back ]

Zones are mainly meant to be used for buttons.

Sub routines

procedure create zone zone_id, x, y, w, h
procedure free zone zone_id
function zone(x, y)
function zone(zone_id)
function zone()
function zonex(zone_id), function zoney(zone_id), function zonew(zone_id), function zoneh(zone_id)


procedure create zone zone_id, x, y, w, h

Create zone zone_id at x, y and set its width and height to w, h. The id shouldn't be set to 0.


procedure free zone zone_id

Free zone zone_id. All zones are automaticly freed when program exits.


function zone(x, y)

Return id of any zone at position x, y. If the coordinates are not inside any zone, 0 is returned.


function zone(zone_id)

Return status of zone zone_id. If 0 is return, the cursor is not inside the zone, or the zone does not exist. If 1 is returned, the cursor is inside the zone, but no mouse button is pressed. 2 means that the cursor is inside the zone and the mouse button is pressed.


function zone()

Return the id of the latest zone that was clicked on (mouse down and up while cursor was inside the zone). Each click is only reported once. 0 is returned if no zone click has been generated since last time the function was called.


function zonex(zone_id)
function zoney(zone_id)
function zonew(zone_id)
function zoneh(zone_id)

These functions return the x position, y position, width and height of zone zone_id.


[ Back ]