Documentation for gcanvas.ew v0.10.5
Table of Contents

Objects

Everything drawn on the canvas is an 'object'


  • func getGfxCanvasObjectData(object params)   Get the data from an object that has previously been added to the canvas
  • func gfxCanvasObjectAt(integer canvasID, integer xloc, integer yloc)    If an object has been added to the canvas by gfxCanvasAddObject then this system can probably
  • proc setGfxCanvasObjectData(object params, sequence data)    Change the data held by the canvas about an object. It is safest to use getGfxCanvasObjectData
  • const S_*   Should probably be O_* :-)

    Documentation for gcanvas.ew v0.10.5
    Table of Contents

    [func]
    getGfxCanvasObjectData
    (object params)

    Get the data from an object that has previously been added to the canvas

    Returns: The data the canvas holds about the object

    Category: Objects


    params is either a single objectID as returned by gfxCanvasAddObject or a sequence of {canvasID, objectID} which is faster to locate.

    the returned sequence can be access with the S_* constants.

    See Also: gfxCanvasObjectAt, setGfxCanvasObjectData, S_*


    Documentation for gcanvas.ew v0.10.5
    Table of Contents

    [func]
    gfxCanvasObjectAt
    (integer canvasID, integer xloc, integer yloc)

    If an object has been added to the canvas by gfxCanvasAddObject then this system can probably

    Returns: It will return the objectID as returned by gfxCanvasAddObject or 0 if no object

    Category: Objects

    do a pretty good job at telling you if the object falls in the vicinity of xloc,yloc (canvas coordinates) though this is by no means entirely accurate (it is done with a bounding box)

    See also gfxCanvasAttachHandler and the demo for how this is used

    See Also: getGfxCanvasObjectData, setGfxCanvasObjectData, S_*


    Documentation for gcanvas.ew v0.10.5
    Table of Contents

    [proc]
    setGfxCanvasObjectData
    (object params, sequence data)

    Change the data held by the canvas about an object. It is safest to use getGfxCanvasObjectData

    Category: Objects

    to get the data, then change it, then set it back with this routine as no error checking is performed.
    You use the S_* constants

    See Also: getGfxCanvasObjectData, gfxCanvasObjectAt, S_*


    Documentation for gcanvas.ew v0.10.5
    Table of Contents

    [const]
    S_*

    Should probably be O_* :-)

    Category: Objects


    S_ID is the unique ID of the object added
    S_STARTX
    S_STARTY are the coordinates of the shape starting position
    S_COLOUR is well, the colour
    S_TYPE is one of the graphex types, "line", "rect-solid", etc
    S_POINTS is the apropriate sequence of points for the shape/object type
    S_PROPERTY is another way of getting the object property see setGfxCanvasObjectProperty
    S_BBOX, the outlining bounding box of the shape/object
    /n These are best used with getGfxCanvasObjectData and setGfxCanvasObjectData

    See Also: getGfxCanvasObjectData, gfxCanvasObjectAt, setGfxCanvasObjectData