Documentation for graphex.ew v0.10.5
Table of Contents

Introduction

see also: 0_StartHere
------------------NOTICE-------------------------------*
 Software ID: graphex.ew
  Version:     0.10.5 29/November/2006 
 Copyright:   (c) 2006 Gary Shingles
              All rights reserved.
 Licence:
 This software is provided 'as-is', without any express or implied warranty.
 In no event will the authors be held liable for any damages arising from
 the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. 2. If you use this software in a product, acknowedgement in the product's documenation and binary are required. 3. Altered source versions, and works substantially derived from the it, must... a) be plainly be marked as such, b) not be misrepresented as the original software, c) include this notice, unaltered. ------------------End of NOTICE------------------------*


Table of Contents

Topic

Description

IndexAlphabetical list of all items.
0_StartHereThe graphex.ew system is generalised buffered drawing system on top of win32lib.
1_GoalsThe main aim of graphex is to ease the use of simple graphics in a win32lib application.
2_ContributorsMany thanks to RDS for Euphoria, the community at EUForum and the win32lib team.
3_HistoryA brief chronology, see also changelog.txt:
ColourHow to use colours with graphex.ew
DataAccessing data associated with a gfx object
DrawingInformation about the gfx_draw(..) routine.
FontDrawing text on a gfx.
InternalInfo for people interested in the internals of graphex.ew
MiscMisc stuff :)
Painting There are two ways to draw with this system, rely on AutoPainting see setGfxAutoPaint or call doGfxPaint to do all needed painting at one time (which is usually better)
ShapeShapes are shapes, sprites have a location
SpriteA sprite is a shape with starting coordinates
TODOList of things to do to improve this system.
UtilsUseful routines

Index

0_StartHere
1_Goals
2_Contributors
3_History
AutoUpdate [var] Controls whether auto painting will occur or not
blank_gfx [var] Empty gfx object
cleanDirtyRects [proc] removes all references to gfxid from the dirty_rects structure
Colour
COMPASS_* [var] Compass point directions for (currently faulty) gfxSpriteOverlap
current_font [var] tracks currently selected font
Data
dirty_rects [var] A sequence of areas that need redrawing during every WM_PAINT
doGfxPaint [proc] Have Windows draw any updates to any gfx in the specified window
Drawing
DR_* [var] Sequence indices for the dirty rectangle system
enumGfxFonts [func] Get a list of known font names
Font
font_scale [var] Routines dealing with getting the gfx's drawn
font_x [var] This is the calculated width of a font character
font_y [var] This is the calculated height of the font characters
forcePaint [proc] forces repainting of all gfxs in the specified window
gfxAddDirty [proc] Manually add a dirty rectangle to the system (see DR_*)
gfxAttachHandler [proc] Attach a handler for an event to the gfx
gfxBuf [func] Get the win32lib id of the Pixmap buffer of the gfx
gfxCharOurAt [proc] Draw a single character of colour at x,y on the gfx
gfxClear [proc] Clears a gfx to the specified colour
gfxColor [func] Synonym for gfxColour
gfxColour [func] Retreive a colour from the gfx_colour sequence using Euphoria colour constants
gfxControl [func] Get the id of the Bitmap control associated with the gfx
gfxDestroy [proc] Destroy a gfx when you are finished with it
gfxfont [var] sequence holding sequences of gfx-fonts
gfxHeight [func] Get the height of the gfx object
gfxHidden [func] Returns w32True if the gfx object is hidden
gfxHide [proc] Set the hidden status of the gfx object. Supply w32True or w32False
gfxParent [func] Get the parent win32lib id of the gfx
gfxPointInRect [func] Determine if point_x, point_y is inside the rectangle rect
gfxPointInSprite [func] Call to determine whether point_x, point_y is within a sprite (which is a shape data with location coordinates in the form of {x, y, {shape_data}}. Not to be confused with gfxPointInRect which determines if a point is in a rectangular area.
gfxRedrawRect [proc] Analogue of repaintRect :
gfxResize [proc] Resize the gfx to new width, new height
gfxs [var]
gfxScaleShape [func] Scales a shape in size
gfxShapeDataExtent [func] Finds the bounding rectangle dimensions of shape data
gfxShapeExtent [func] Finds the actual bounding rectangle coordinates of a sprite
gfxSpriteOverlap [func] Find out how, if at all, sprite1 overlaps sprite2.
gfxTextOutAt [proc] Draw text in the line drawing font at x,y in one colour on the gfx
gfxUpdate [proc] Update the internal state of a gfx after changing the size or location of the gfx control
gfxWidth [func] Get the width of a Gfx object
gfxX [func] Get the X coordinate of the gfx object in its parent
gfxY [func] Get the Y coordinate of the gfx object in its parent
GFX_* [var]
gfx_color [var] Synonym for gfx_colour
gfx_colour [var] Global sequence of 'DOS like' colours
gfx_draw [proc] The main generalised drawing procedure
gfx_paint [func] The w32HPaint hander for each gfx object
GFX_TOP [var] Sequence length verification
GI [func] get the index into the gfxs sequence of the gfx with id gfx_id
GP_* [const] GP are constants for "graphex primitives"
GREY [var] Synonym for GRAY
Internal
in_round [func] Round to nearest integer
last_id [var] unique id counter for gfxs
Misc
newGfx [func] Creates a new gfx object
Painting
putch [var] Routine id of the character drawing routine
SCREENHEIGHT [func] Get the full screen height available
SCREENWIDTH [func] Get the full screen size available width
setGfxAutoPaint [proc] Turn on or off AutoPainting
setGfxFont [func] Select the font by name.
setGfxFontScale [func] Change the size of the font characters that will be drawn by a gfxCharOutAt or gfxTextOutAt
Shape
Sprite
TODO
total_rect [func] Find the greatest encompassing rectangle of all the dirty_rects
Utils