Difference between revisions of "Category:gc"

From Inspired-Lua Wiki
Jump to navigation Jump to search
Line 3: Line 3:
 
All these functions are called like that : '''gc:''drawString'''''(...)
 
All these functions are called like that : '''gc:''drawString'''''(...)
  
 +
== Quick Overview==
 
*'''[[begin]]''' -
 
*'''[[begin]]''' -
 
*'''[[clipRect]]'''(?, x, y, width, height) -
 
*'''[[clipRect]]'''(?, x, y, width, height) -
Line 22: Line 23:
 
*'''[[setFont]]'''(font, type, size), with font : {“sansserif”, "serif", ..}, type {“b”, “r”, “i”}, size(int)
 
*'''[[setFont]]'''(font, type, size), with font : {“sansserif”, "serif", ..}, type {“b”, “r”, “i”}, size(int)
 
*'''[[setPen]]'''(thickness, smoothness) : thickness {“thin”, “medium”, "thick"}, smoothness {“smooth”, "dotted", "dashed"}
 
*'''[[setPen]]'''(thickness, smoothness) : thickness {“thin”, “medium”, "thick"}, smoothness {“smooth”, "dotted", "dashed"}
 +
<br>

Revision as of 16:30, 22 May 2011

"gc" is the Graphics Context.
All these functions are called like that : gc:drawString(...)

Quick Overview

  • begin -
  • clipRect(?, x, y, width, height) -
  • drawArc(x, y, width, height, start angle, finish angle).
  • drawImage(image,x,y) First argument in format “TI.Image”, x and y the coords.
  • drawLine(xstart, ystart, xend, yend) Draws a line starting at the point (xstart,ystart) and ending at the point (xend, yend)
  • drawPolyLine(int list1 [,int list2, .., int listN]) Draws a shape from a list contaning successively the x and y coordinates of each point the line have to draw.
  • drawRect(x, y, xwidth, yheight) Draws a rectangle at (x,y) with the “x” side being “xwidth” long and the “y” side being “yheight” long
  • drawString(string, x, y, PositionString) PositionString is the string’s anchor point and can be "baseline", “bottom”, “middle”, or “top”.
  • fillArc(x, y, width, height, start angle, finish angle) see drawArc
  • fillPolygon(int list1 [,int list2, .., int listN]) see drawPolyLine
  • fillRect(x, y, width, height) see drawRect
  • finish -
  • getStringHeight(string) - Returns the string's height.
  • getStringWidth(string) - Returns the string's width
  • isColorDisplay Bool (Read-only) Returns 1 if the device has a color display, 0 if not.
  • setAlpha(alpha) - where alpha is an integer between 0 and 255. Sets the transparency.
  • setColorRGB(red, green, blue) RGB values are integers, from 0 to 255.
  • setFont(font, type, size), with font : {“sansserif”, "serif", ..}, type {“b”, “r”, “i”}, size(int)
  • setPen(thickness, smoothness) : thickness {“thin”, “medium”, "thick"}, smoothness {“smooth”, "dotted", "dashed"}