<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.spheredev.org/index.php?action=history&amp;feed=atom&amp;title=Legacy%3ASurface</id>
		<title>Legacy:Surface - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.spheredev.org/index.php?action=history&amp;feed=atom&amp;title=Legacy%3ASurface"/>
		<link rel="alternate" type="text/html" href="http://wiki.spheredev.org/index.php?title=Legacy:Surface&amp;action=history"/>
		<updated>2026-05-16T23:12:04Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.29.0</generator>

	<entry>
		<id>http://wiki.spheredev.org/index.php?title=Legacy:Surface&amp;diff=692&amp;oldid=prev</id>
		<title>Apollolux: /* See also */ add category</title>
		<link rel="alternate" type="text/html" href="http://wiki.spheredev.org/index.php?title=Legacy:Surface&amp;diff=692&amp;oldid=prev"/>
				<updated>2013-06-04T05:32:24Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;See also: &lt;/span&gt; add category&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 05:32, 4 June 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l91&quot; &gt;Line 91:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 91:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{API:Surface/navbox}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{API:Surface/navbox}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Objects]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Apollolux</name></author>	</entry>

	<entry>
		<id>http://wiki.spheredev.org/index.php?title=Legacy:Surface&amp;diff=691&amp;oldid=prev</id>
		<title>Apollolux: created from http://web.archive.org/web/20110801003448/http://www.spheredev.org/wiki/Object-Surface</title>
		<link rel="alternate" type="text/html" href="http://wiki.spheredev.org/index.php?title=Legacy:Surface&amp;diff=691&amp;oldid=prev"/>
				<updated>2013-06-04T05:31:40Z</updated>
		
		<summary type="html">&lt;p&gt;created from http://web.archive.org/web/20110801003448/http://www.spheredev.org/wiki/Object-Surface&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The [[API:Surface|Surface]] object is like an off-screen canvas on which you can draw and manipulate image data.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Initializers==&lt;br /&gt;
&lt;br /&gt;
* [[API:CreateSurface|CreateSurface]](''width'', ''height'', ''color''): Create a [[API:Surface|Surface]] of dimensions (''width'', ''height''), filled with ''color''.&lt;br /&gt;
* [[API:GrabSurface|GrabSurface]](''x'', ''y'', ''width'', ''height''): Grab the screen contents at (''x'', ''y'', ''width'', ''height'') and store it in a new Surface.&lt;br /&gt;
* [[API:Image/createSurface|Image.createSurface]](): Create a new [[API:Surface|Surface]] using the picture data in the image.&lt;br /&gt;
* [[API:LoadSurface|LoadSurface]](''filename''): Create a [[API:Surface|Surface]] from an image given by ''filename''.&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
* [[API:Surface/clone|Surface.clone]](): Create a copy of the surface object.&lt;br /&gt;
* [[API:Surface/cloneSection|Surface.cloneSection]](x, y, w, h): returns a new surface object with the height and width of h and w, with part of image at (x,y) from the surface_object with the width w and height h.&lt;br /&gt;
* [[API:Surface/blit|Surface.blit]](''x'', ''y''): Draw the surface on the screen at (''x'', ''y'').&lt;br /&gt;
* [[API:Surface/blitSurface|Surface.blitSurface]](surface, x, y): draws 'surface' onto 'surface_object' at (x,y)&lt;br /&gt;
* [[API:Surface/blitImage|Surface.blitImage]](''image_object'', ''x'', ''y''): draws 'image' onto 'surface_object' at (x,y)&lt;br /&gt;
* [[API:Surface/blitMaskSurface|Surface.blitMaskSurface]](surface, x, y, mask [, mask_blend_mode]): draws 'surface' onto the surface_object at (x, y), except that the color passed as 'mask' tints 'surface'; optionally you can pass one of the blend modes for masking as mask_blend_mode&lt;br /&gt;
* [[API:Surface/rotateBlitSurface|Surface.rotateBlitSurface]](surface, x, y, angle): draws 'surface' onto the surface_object at (x, y), except that 'surface' is rotated anti-clockwise in radians, with -2*PI &amp;lt;= angle &amp;lt;= 2*PI&lt;br /&gt;
* [[API:Surface/rotateBlitMaskSurface|Surface.rotateBlitMaskSurface]](surface, x, y, angle, mask [, mask_blend_mode]): [[API:Surface/rotateBlitSurface|rotateBlitSurface]] + [[API:Surface/blitMaskSurface|blitMaskSurface]]&lt;br /&gt;
* [[API:Surface/zoomBlitSurface|Surface.zoomBlitSurface]](surface, x, y, factor): draws 'surface' onto the surface_object at (x, y) with zooming, with the scaling depending on factor. Normally a factor of 1 will draw a normal looking 'surface' and between 0 and 1 will shrink it. Any values greater than 1 will stretch it's size.&lt;br /&gt;
* [[API:Surface/zoomBlitMaskSurface|Surface.zoomBlitMaskSurface]](surface, x, y, factor, mask [, mask_blend_mode]): [[API:Surface/zoomBlitSurface|zoomBlitSurface]] + [[API:Surface/blitMaskSurface|blitMaskSurface]]&lt;br /&gt;
* [[API:Surface/transformBlitSurface|Surface.transformBlitSurface]](surface, x1, y1, x2, y2, x3, y3, x4, y4): draws 'surface' onto the surface_object with &amp;quot;transformation&amp;quot;, where (x1, y1) is the upper left corner, (x2, y2) the upper right corner, (x3, y3) is the lower right corner, and (x4, y4) is the lower left corner.&lt;br /&gt;
* [[API:Surface/transformBlitMaskSurface|Surface.transformBlitMaskSurface]](surface, x1, y1, x2, y2, x3, y3, x4, y4, mask [, mask_blend_mode]): [[API:Surface/transformBlitSurface|transformBlitSurface]] + [[API:Surface/blitMaskSurface|blitMaskSurface]]&lt;br /&gt;
* [[API:Surface/createImage|Surface.createImage]](): Create a new [[API:Image|Image]] with the picture data in the surface.&lt;br /&gt;
* [[API:Surface/save|Surface.save]](filename): saves the surface_object as an image using the filename 'filename'; the image type is determined by the extension of the file, e.g. surface.save(&amp;quot;test.png&amp;quot;) saves a png image called test.png&lt;br /&gt;
* [[API:Surface/setBlendMode|Surface.setBlendMode]](mode): Sets the blend mode of the surface, which will affect any drawing operation on the surface. 'mode' must be one of the available [[blend modes]] for surfaces.&lt;br /&gt;
*: BLEND (default for drawing)&lt;br /&gt;
*: REPLACE&lt;br /&gt;
*: RGB_ONLY&lt;br /&gt;
*: ALPHA_ONLY&lt;br /&gt;
*: ADD&lt;br /&gt;
*: SUBTRACT&lt;br /&gt;
*: MULTIPLY (default for masking)&lt;br /&gt;
*: AVERAGE&lt;br /&gt;
*: INVERT&lt;br /&gt;
* [[API:Surface/setAlpha|Surface.setAlpha]](alpha): sets the alpha of the surface&lt;br /&gt;
* [[API:Surface/getPixel|Surface.getPixel]](''x'', ''y''): Get the color of the pixel at (''x'', ''y'') on the surface.&lt;br /&gt;
* [[API:Surface/setPixel|Surface.setPixel]](x, y, color): Set the pixel at (''x'', ''y'') on the surface to ''color''.&lt;br /&gt;
* [[API:Surface/replaceColor|Surface.replaceColor]](oldColor, newColor): replace all pixels of the color oldColor in the surface with newColor&lt;br /&gt;
* [[API:Surface/rotate|Surface.rotate]](''angle'', ''resize''): Rotate the surface by ''angle'' radians, ''resize'' to fit if requested.&lt;br /&gt;
* [[API:Surface/resize|Surface.resize]](w, h): resizes the surface images. This does not stretch or shrink the image inside the surface.&lt;br /&gt;
* [[API:Surface/rescale|Surface.rescale]](w, h): stretches or shrinks the surface to the new width w and height h&lt;br /&gt;
* [[API:Surface/flipHorizontally|Surface.flipHorizontally]](): flips the surface horizontally&lt;br /&gt;
* [[API:Surface/flipVertically|Surface.flipVertically]](): flips the surface vertically&lt;br /&gt;
* [[API:Surface/applyLookup|Surface.applyLookup]](x, y, w, h, red_lookup, green_lookup, blue_lookup, alpha_lookup): Apply a lookup table transformation to the pixels contained in x, y, w, h&lt;br /&gt;
*:	The lookup parameters are arrays of 256 elements containg the new pixel values, ex: &amp;lt;code&amp;gt;var invert_lookup = [255, 254, 253, 252, 251, ..., 4, 3, 2, 1, 0];&amp;lt;/code&amp;gt;&lt;br /&gt;
* [[API:Surface/applyColorFX|Surface.applyColorFX]](x, y, w, h,  colormatrix): Apply the colormatrix to the pixels contained in x, y, w, h (see [[API:CreateColorMatrix|CreateColorMatrix]])&lt;br /&gt;
* [[API:Surface/applyColorFX4|Surface.applyColorFX4]](x, y, w, h,  cm_upperleft, cm_upperright, cm_lowerleft, cm_lowerright): Apply 4 color matrices. Each corner has a separate color matrix. (see [[API:CreateColorMatrix|CreateColorMatrix]])&lt;br /&gt;
* [[API:Surface/pointSeries|Surface.pointSeries]](array, color): plots a series of points colored with color onto the surface with array filled with objects (each object must have a 'x' and 'y' property)&lt;br /&gt;
* [[API:Surface/line|Surface.line]](''x1'', ''y1'', ''x2'', ''y2'', ''color''): Draw a line onto the surface starting from (''x1'', ''y1'') to (''x2'', ''y2'') with ''color''.&lt;br /&gt;
* [[API:Surface/gradientLine|Surface.gradientLine]](''x1'', ''y1'', ''x2'', ''y2'', ''color1'', ''color2''): Draw a line onto the surface starting from (''x1'', ''y1'') to (''x2'', ''y2'') with a color fade from ''color1'' to ''color2''.&lt;br /&gt;
* [[API:Surface/lineSeries|Surface.lineSeries]](array, color [, type]): draws a series of lines colored with color onto the surface with array filled with objects (each object must have a 'x' and 'y' property)&lt;br /&gt;
* [[API:Surface/bezierCurve|Surface.bezierCurve]](color, step, Ax, Ay, Bx, By, Cx, Cy [, Dx] [, Dy]): Draws a Bezier curve colored with color onto the surface with step being a floating point number in the range 0 &amp;lt; step &amp;lt;= 1.0 and the points:&lt;br /&gt;
*:	(Ax, Ay: coordinates of the endpoint A),&lt;br /&gt;
*:	(Bx, By: coordinates of A's control point B)&lt;br /&gt;
*:	(Cx, Cy: coordinates of the endpoint C)&lt;br /&gt;
*:	(Dx, Dy: optional, coordinates of C's control point D - if omitted, B is also C's control point)&lt;br /&gt;
* [[API:Surface/outlinedRectangle|Surface.outlinedRectangle]](''x'', ''y'', ''width'', ''height'', ''color'' [, ''size'']): Draw an outlined rectangle onto the surface at (''x'', ''y'') of ''width'' and ''height'' colored with ''color'' and with ''size'' determining the thickness.&lt;br /&gt;
* [[API:Surface/rectangle|Surface.rectangle]](''x1'', ''y1'', ''x2'', ''y2'', ''color''): Draw a filled rectangle on the surface from (''x1'', ''y1'') to  (''x2'', ''y2'') with ''color''.&lt;br /&gt;
* [[API:Surface/gradientRectangle|Surface.gradientRectangle]](x, y, w, h, c_ul, c_ur, c_lr, c_ll): Draws a gradient rectangle onto the surface at (x,y) with the height h and width w and a gradient of colors graduating from each corner of the rectangle as follows:&lt;br /&gt;
*:	c_ul = color of upper left corner &lt;br /&gt;
*:	c_ur = color of upper right corner&lt;br /&gt;
*:	c_lr = color of lower right corner&lt;br /&gt;
*:	c_ll = color of lower left corner&lt;br /&gt;
* [[API:Surface/triangle|Surface.triangle]](''x1'', ''y1'', ''x2'', ''y2'', ''x3'', ''y3'', ''color''): Draw a filled triangle with points (''x1'', ''y1''), (''x2'', ''y2''), (''x3'', ''y3'') with ''color''.&lt;br /&gt;
* [[API:Surface/gradientTriangle|Surface.gradientTriangle]](x1, y1, x2, y2, x3, y3, c1, c2, c3): Draws a gradient triangle onto the surface with the points (x1, y1), (x2, y2), (x3, y3), with each point (c1 = color of (x1, y1), c2 = color of (x2, y2), c3 = color of (x3, y3)) having a color to generate the gradient of the triangle&lt;br /&gt;
* [[API:Surface/polygon|Surface.polygon]](array, color [, invert]): draws a filled polygon colored with color onto the surface with array filled with objects (each object must have a 'x' and 'y' property)&lt;br /&gt;
*:	If invert is true, all points in the bounding box of the polygon, but not in the polygon will be colored.&lt;br /&gt;
* [[API:Surface/outlinedEllipse|Surface.outlinedEllipse]](x, y, rx, ry, c): Draws an outlined ellipse at (x, y) with rx being the horizontal radius and ry the vertical radius onto the surface with the color c&lt;br /&gt;
* [[API:Surface/filledEllipse|Surface.filledEllipse]](x, y, rx, ry, c): Draws a filled ellipse at (x, y) with rx being the horizontal radius and ry the vertical radius onto the surface with the color c&lt;br /&gt;
* [[API:Surface/outlinedCircle|Surface.outlinedCircle]](x, y, radius, color [, antialias]): Draws an outlined circle at (x, y) colored with color onto the surface if antialias is true, the circle will be antialiased&lt;br /&gt;
* [[API:Surface/filledCircle|Surface.filledCircle]](x, y, radius, color [, antialias]): Draws a filled circle at (x, y) colored with color onto the surface if antialias is true, the circle will be antialiased&lt;br /&gt;
* [[API:Surface/gradientCircle|Surface.gradientCircle]](x, y, radius, color1, color2 [, antialias]): Draws a gradient circle at (x, y) onto the surface colored with a fading color from color1 to color2 if antialias is true, the circle will be antialiased&lt;br /&gt;
* [[API:Surface/drawText|Surface.drawText]](font, x, y, text): draws 'text' at x, y with the font onto the surface_object&lt;br /&gt;
* [[API:Surface/drawZoomedText|Surface.drawZoomedText]](font, x, y, scale, text): draws scaled text (1.0 = normal) with (x,y) as the upper left corner onto the surface_object&lt;br /&gt;
* [[API:Surface/drawTextBox|Surface.drawTextBox]](font, x, y, w, h, offset, text): draws a word-wrapped text at (x, y) onto the surface_object with the width w and height h. The offset is the number of pixels which the number of pixels from y which the actual drawing starts at. See [[API:Font/drawTextBox|Font.drawTextBox]] for more detail.&lt;br /&gt;
&lt;br /&gt;
==Members==&lt;br /&gt;
*	'''width''' unsigned integer, read-only. Width of the surface in pixels.&lt;br /&gt;
*	'''height''' unsigned integer, read-only. Height of the surface in pixels.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
*	It is faster to blit an image to screen than a surface, but it is much easier to manipulate a surface.&lt;br /&gt;
*	The Surface object can be used to quickly make custom screenshots:&amp;lt;br/&amp;gt;&amp;lt;syntaxhighlight&amp;gt;GrabSurface(0, 0, GetScreenWidth(), GetScreenHeight()).save(&amp;quot;my_screenshot.png&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*	The fundamental pixel colors can be altered in any way using [[API:Surface/applyLookup|Surface.applyLookup]](), or the Sphere [[API:ColorMatrix|ColorMatrix]] object functions [[API:Surface/applyColorFX|Surface.applyColorFX]]() and [[API:Surface/applyColorFX4|Surface.applyColorFX4]]().&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*	Sphere [[API:ColorMatrix|ColorMatrix]] object&lt;br /&gt;
*	Sphere [[API:Image|Image]] object&lt;br /&gt;
&lt;br /&gt;
{{API:Surface/navbox}}&lt;/div&gt;</summary>
		<author><name>Apollolux</name></author>	</entry>

	</feed>