This wiki is out of date, use the continuation of this wiki instead

Mouse

From FenixWiki

Revision as of 15:11, 1 May 2007 by Sandman (Talk | contribs)
Jump to: navigation, search

Definition

Struct Mouse

The struct mouse contains several variables:

x - The X-coordinate of the mouse.
y - The Y-coordinate of the mouse.
graph - The graphID of the graph of the mouse (you can change this to suit your needs).
file - The fileID of the file in which the graph of the mouse is located.
z - The Z-coordinate of the mouse.
angle - The angle of the mouse process.
size - The size of the mouse process.
flags - The render flags of the mouse process.
region - The region of the mouse process.
left - Indicates whether the left mouse button is pressed (true/false).
middle - Indicates whether the middle mouse button is pressed (true/false).
right - Indicates whether the right mouse button is pressed (true/false).
wheelup - Indicates whether the mouse wheel is scrolled upwards (true/false).
wheeldown - Indicates whether the mouse wheel is scrolled downwards (true/false).

Example

Program mousepointer;
Private
    int dmap;
    int rmap;
    int gmap;
    int bmap;
    int ymap;
    int cmap;
    int mmap;
    int wmap;
Begin

    // Create a dark graph
    dmap = new_map(100,100,8);
    map_clear(0,dmap,rgb(50,50,50));

    // Create a red graph
    rmap = new_map(100,100,8);
    map_clear(0,rmap,rgb(255,0,0));

    // Create a green graph
    gmap = new_map(100,100,8);
    map_clear(0,gmap,rgb(0,255,0));

    // Create a blue graph
    bmap = new_map(100,100,8);
    map_clear(0,bmap,rgb(0,0,255));

    // Create a yellow graph
    ymap = new_map(100,100,8);
    map_clear(0,ymap,rgb(255,255,0));

    // Create a cyan graph
    cmap = new_map(100,100,8);
    map_clear(0,cmap,rgb(0,255,255));

    // Create a magenta graph
    mmap = new_map(100,100,8);
    map_clear(0,mmap,rgb(255,0,255));

    // Create a white graph
    wmap = new_map(100,100,8);
    map_clear(0,wmap,rgb(255,255,255));

    Loop
    	if(mouse.left) // +Red
            if(mouse.right) // +Green
                if(mouse.middle) // +Blue
                    mouse.graph = wmap;
                else
                    mouse.graph = ymap;
                end
            else
                if(mouse.middle) // +Blue
                    mouse.graph = mmap;
                else
                    mouse.graph = rmap;
                end
            end
        elseif(mouse.right) // +Green
            if(mouse.middle) // +Blue
                mouse.graph = cmap;
            else
                mouse.graph = gmap;
            end
        elseif(mouse.middle) // +Blue
            mouse.graph = bmap;
        else // Dark
            mouse.graph = dmap;
        end
        frame;
    End

End

Used in example: new_map(), map_clear(), graph

Shows some use of maps and the mouse.

Here the right and middle mouse buttons are pressed:
mouse.PNG

Personal tools