Difference between revisions of "User:Cyanox"

Line 22: Line 22:
 
| ?PrettySince
 
| ?PrettySince
 
| ?PrettyRemoved
 
| ?PrettyRemoved
| ?Since -
+
| ?Since# -
 
}}
 
}}
 
== Functions ==
 
== Functions ==

Revision as of 22:26, 29 March 2013

Using this as personal SandBox mostly ;)

The primary responsibility for the love.graphics module is the drawing of lines, shapes, text, Images and other Drawable objects onto the screen. Its secondary responsibilities include loading external files (including Images and Fonts) into memory, creating specialized objects (such as ParticleSystems or Canvases) and managing screen geometry.

LÖVE's coordinate system is rooted in the upper-left corner of the screen, which is at location (0, 0). The x axis is horizontal: larger values are further to the right. The y axis is vertical: larger values are further towards the bottom.

The LÖVE coordinate system

In many cases, you draw images or shapes in terms of their upper-left corner (See the picture above).

Many of the functions are used to manipulate the graphics coordinate system, which is essentially the the way coordinates are mapped to the display. You can change the position, scale, and even rotation in this way.


Types

Canvas Off-screen render target. Added since 0.8.0 Deprecated in 080
Drawable Superclass for all things that can be drawn on screen. Deprecated in 000
Font Defines the shape of characters than can be drawn onto the screen. Deprecated in 000
Framebuffer Off-screen render target. Added since 0.7.0 Removed in 0.8.0
Image Drawable image type. Deprecated in 000
Mesh A 2D polygon mesh used for drawing arbitrary textured shapes. Added since 0.9.0 Deprecated in 090
ParticleSystem Used to create cool effects, like fire. Deprecated in 000
PixelEffect Pixel shader effect. Added since 0.8.0 Removed in 0.9.0
Quad A quadrilateral with texture coordinate information. Deprecated in 000
Shader Shader effect. Added since 0.9.0 Deprecated in 090
SpriteBatch Store image positions in a buffer, and draw it in one call. Deprecated in 000
Text Drawable text. Added since 0.10.0 Deprecated in 100
Texture Superclass for drawable objects which represent a texture. Added since 0.9.1 Deprecated in 091
Video A drawable video. Added since 0.10.0 Deprecated in 100

Functions

Drawing

love.graphics.arc Draws an arc. Added since 0.8.0 Deprecated in 080
love.graphics.circle Draws a circle. Deprecated in 000
love.graphics.clear Clears the screen or active Canvas to the specified color. Deprecated in 000
love.graphics.discard Discards the contents of the screen or active Canvas. Added since 0.10.0 Deprecated in 100
love.graphics.draw Draws objects on screen. Deprecated in 080, 000
love.graphics.drawInstanced Draws many instances of a Mesh with a single draw call, using hardware geometry instancing. Added since 11.0 Deprecated in 110
love.graphics.drawLayer Draws a layer of an Array Texture. Added since 11.0 Deprecated in 110
love.graphics.drawq Draw a Quad with the specified Image on screen. Removed in 0.9.0
love.graphics.ellipse Draws an ellipse. Added since 0.10.0 Deprecated in 100
love.graphics.flushBatch Immediately renders any pending automatically batched draws. Added since 11.0 Deprecated in 110
love.graphics.line Draws lines between points. Deprecated in 000
love.graphics.point Draws a point. Removed in 0.10.0
love.graphics.points Draws one or more points. Added since 0.10.0 Deprecated in 100
love.graphics.polygon Draw a polygon. Added since 0.4.0 Deprecated in 040
love.graphics.present Displays the results of drawing operations on the screen. Deprecated in 000
love.graphics.print Draws text on screen. If no Font is set, one will be created and set (once) if needed. Deprecated in 080, 000
love.graphics.printf Draws formatted text, with word wrap and alignment. Deprecated in 000
love.graphics.quad Draws a quadrilateral shape. Removed in 0.9.0
love.graphics.rectangle Draws a rectangle. Added since 0.3.2 Deprecated in 032
love.graphics.stencil Draws geometry as a stencil. Added since 0.10.0 Deprecated in 100
love.graphics.triangle Draws a triangle. Removed in 0.9.0

Object Creation

love.graphics.captureScreenshot Creates a screenshot once the current frame is done. Added since 11.0 Deprecated in 110
love.graphics.newArrayImage Creates a new array Image. Added since 11.0 Deprecated in 110
love.graphics.newCanvas Creates a new Canvas. Added since 0.8.0 Deprecated in 080
love.graphics.newCubeImage Creates a new cubemap Image. Added since 11.0 Deprecated in 110
love.graphics.newFont Creates a new Font from a TrueType Font or BMFont file. Deprecated in 000, 100
love.graphics.newFramebuffer Creates a new Framebuffer. Added since 0.7.0 Removed in 0.8.0
love.graphics.newImage Creates a new Image. Deprecated in 000
love.graphics.newImageFont Creates a new Font by loading a specifically formatted image. Added since 0.2.0 Deprecated in 020
love.graphics.newMesh Creates a new Mesh. Added since 0.9.0 Deprecated in 090
love.graphics.newParticleSystem Creates a new ParticleSystem. Deprecated in 000
love.graphics.newPixelEffect Creates a new PixelEffect. Added since 0.8.0 Removed in 0.9.0
love.graphics.newQuad Creates a new Quad. Deprecated in 000
love.graphics.newScreenshot Creates a screenshot and returns the ImageData. Removed in 11.0
love.graphics.newShader Creates a new Shader. Added since 0.9.0 Deprecated in 090
love.graphics.newSpriteBatch Creates a new SpriteBatch. Deprecated in 000
love.graphics.newStencil Creates a new stencil. Added since 0.8.0 Removed in 0.9.0
love.graphics.newText Creates a new drawable Text object. Added since 0.10.0 Deprecated in 100
love.graphics.newVideo Creates a new Video. Added since 0.10.0 Deprecated in 100
love.graphics.newVolumeImage Creates a new volume Image. Added since 11.0 Deprecated in 110
love.graphics.setNewFont Creates and sets a new Font. Added since 0.8.0 Deprecated in 080
love.graphics.validateShader Validates shader code. Added since 11.0 Deprecated in 110

Graphics State

love.graphics.getBackgroundColor Gets the current background color. Deprecated in 000
love.graphics.getBlendMode Gets the blending mode. Added since 0.2.0 Deprecated in 020
love.graphics.getCanvas Returns the current target Canvas. Added since 0.8.0 Deprecated in 080
love.graphics.getColor Gets the current color. Deprecated in 000
love.graphics.getColorMask Gets the active color components used when drawing. Added since 0.9.0 Deprecated in 090
love.graphics.getColorMode Gets the color mode (which controls how images are affected by the current color). Added since 0.2.0 Removed in 0.9.0
love.graphics.getDefaultFilter Returns the default scaling filters used with Images, Canvases, and Fonts. Added since 0.9.0 Deprecated in 090
love.graphics.getDefaultImageFilter Returns the default scaling filters. Added since 0.8.0 Removed in 0.9.0
love.graphics.getDepthMode Gets the current depth test mode and whether writing to the depth buffer is enabled. Added since 11.0 Deprecated in 110
love.graphics.getFont Gets the current Font object. Added since 0.9.0 Deprecated in 090
love.graphics.getFrontFaceWinding Gets whether triangles with clockwise- or counterclockwise-ordered vertices are considered front-facing. Added since 11.0 Deprecated in 110
love.graphics.getLineJoin Gets the line join style. Deprecated in 090
love.graphics.getLineStipple Gets the current line stipple. Removed in 0.8.0
love.graphics.getLineStyle Gets the line style. Added since 0.3.2 Deprecated in 032
love.graphics.getLineWidth Gets the current line width. Added since 0.3.2 Deprecated in 032
love.graphics.getMeshCullMode Gets whether back-facing triangles in a Mesh are culled. Added since 11.0 Deprecated in 110
love.graphics.getPixelEffect Returns the current PixelEffect. Added since 0.8.0 Removed in 0.9.0
love.graphics.getPointSize Gets the point size. Deprecated in 000
love.graphics.getPointStyle Gets the current point style. Removed in 0.10.0
love.graphics.getScissor Gets the current scissor box. Added since 0.4.0 Deprecated in 040
love.graphics.getShader Gets the current Shader. Added since 0.9.0 Deprecated in 090
love.graphics.getStackDepth Gets the current depth of the transform / state stack (the number of pushes without corresponding pops). Added since 11.0 Deprecated in 110
love.graphics.getStencilTest Gets the current stencil test configuration. Added since 0.10.0 Deprecated in 100
love.graphics.intersectScissor Sets the scissor to the rectangle created by the intersection of the specified rectangle with the existing scissor. Added since 0.10.0 Deprecated in 100
love.graphics.isActive Gets whether the graphics module is able to be used. Added since 0.10.0 Deprecated in 100
love.graphics.isGammaCorrect Gets whether gamma-correct rendering is enabled. Added since 0.10.0 Deprecated in 100
love.graphics.isSupported Checks for the support of graphics related functions. Added since 0.8.0 Removed in 0.10.0
love.graphics.isWireframe Gets whether wireframe mode is used when drawing. Added since 0.9.1 Deprecated in 091
love.graphics.reset Resets the current graphics settings. Deprecated in 000
love.graphics.setBackgroundColor Sets the background color. Deprecated in 000, 080
love.graphics.setBlendMode Sets the blending mode. Added since 0.2.0 Deprecated in 020
love.graphics.setCanvas Captures drawing operations to a Canvas Added since 0.8.0 Deprecated in 080
love.graphics.setColor Sets the color used for drawing. Deprecated in 000
love.graphics.setColorMask Sets the color mask. Enables or disables specific color components when rendering. Added since 0.9.0 Deprecated in 090
love.graphics.setColorMode Sets the color mode (which controls how images are affected by the current color). Added since 0.2.0 Removed in 0.9.0
love.graphics.setDefaultFilter Sets the default scaling filters used with Images, Canvases, and Fonts. Added since 0.9.0 Deprecated in 090
love.graphics.setDefaultImageFilter Sets the default scaling filters. Added since 0.8.0 Removed in 0.9.0
love.graphics.setDepthMode Configures depth testing and writing to the depth buffer. Added since 11.0 Deprecated in 110
love.graphics.setFont Set an already-loaded Font as the current font. Deprecated in 000
love.graphics.setFrontFaceWinding Sets whether triangles with clockwise- or counterclockwise-ordered vertices are considered front-facing. Added since 11.0 Deprecated in 110
love.graphics.setInvertedStencil Defines an inverted stencil. Added since 0.8.0 Removed in 0.10.0
love.graphics.setLine Sets the line width and style. Removed in 0.9.0
love.graphics.setLineJoin Sets the line join style. Deprecated in 090
love.graphics.setLineStipple Sets the line stipple pattern. Removed in 0.8.0
love.graphics.setLineStyle Sets the line style. Added since 0.3.2 Deprecated in 032
love.graphics.setLineWidth Sets the line width. Added since 0.3.2 Deprecated in 032
love.graphics.setMeshCullMode Sets whether back-facing triangles in a Mesh are culled. Added since 11.0 Deprecated in 110
love.graphics.setPixelEffect Routes drawing operations through a pixel shader. Added since 0.8.0 Removed in 0.9.0
love.graphics.setPoint Sets the point size and style. Removed in 0.9.0
love.graphics.setPointSize Sets the point size. Deprecated in 000
love.graphics.setPointStyle Sets the point style. Removed in 0.10.0
love.graphics.setRenderTarget Captures drawing operations to a Framebuffer Added since 0.7.0 Removed in 0.8.0
love.graphics.setScissor Sets or disables scissor. Added since 0.4.0 Deprecated in 040
love.graphics.setShader Routes drawing operations through a shader. Added since 0.9.0 Deprecated in 090
love.graphics.setStencil Defines or releases a stencil. Added since 0.8.0 Removed in 0.10.0
love.graphics.setStencilTest Configures or disables stencil testing. Added since 0.10.0 Deprecated in 100
love.graphics.setWireframe Sets whether wireframe lines will be used when drawing. Added since 0.9.1 Deprecated in 091

Coordinate System

love.graphics.applyTransform Applies the given Transform object to the current coordinate transformation. Added since 11.0 Deprecated in 110
love.graphics.inverseTransformPoint Converts the given 2D position from screen-space into global coordinates. Added since 11.0 Deprecated in 110
love.graphics.origin Resets the current coordinate transformation. Added since 0.9.0 Deprecated in 090
love.graphics.pop Pops the current coordinate transformation from the transformation stack. Deprecated in 000
love.graphics.push Copies and pushes the current coordinate transformation to the transformation stack. Deprecated in 000
love.graphics.replaceTransform Replaces the current coordinate transformation with the given Transform object. Added since 11.0 Deprecated in 110
love.graphics.rotate Rotates the coordinate system in two dimensions. Deprecated in 000
love.graphics.scale Scales the coordinate system in two dimensions. Deprecated in 000
love.graphics.shear Shears the coordinate system. Added since 0.8.0 Deprecated in 080
love.graphics.transformPoint Converts the given 2D position from global coordinates into screen-space. Added since 11.0 Deprecated in 110
love.graphics.translate Translates the coordinate system in two dimensions. Deprecated in 000

Window

love.graphics.checkMode Checks if a display mode is supported. Removed in 0.9.0
love.graphics.getCaption Gets the window caption. Removed in 0.9.0
love.graphics.getDPIScale Gets the DPI scale factor of the window. Added since 11.0 Deprecated in 110
love.graphics.getDimensions Gets the width and height of the window. Added since 0.9.0 Deprecated in 090
love.graphics.getHeight Gets the height in pixels of the window. Added since 0.2.1 Deprecated in 021
love.graphics.getMode Returns the current display mode. Added since 0.8.0 Removed in 0.9.0
love.graphics.getModes Gets a list of supported fullscreen modes. Removed in 0.9.0
love.graphics.getPixelDimensions Gets the width and height in pixels of the window. Added since 11.0 Deprecated in 110
love.graphics.getPixelHeight Gets the height in pixels of the window. Added since 11.0 Deprecated in 110
love.graphics.getPixelWidth Gets the width in pixels of the window. Added since 11.0 Deprecated in 110
love.graphics.getWidth Gets the width in pixels of the window. Added since 0.2.1 Deprecated in 021
love.graphics.hasFocus Checks if the game window has keyboard focus. Added since 0.8.0 Removed in 0.9.0
love.graphics.isCreated Checks if the window has been created. Removed in 0.9.0
love.graphics.setCaption Sets the window caption. Removed in 0.9.0
love.graphics.setIcon Set window icon. Added since 0.7.0 Removed in 0.9.0
love.graphics.setMode Changes the display mode. Removed in 0.9.0
love.graphics.toggleFullscreen Toggles fullscreen. Removed in 0.9.0

Enums

AlignMode Text alignment. Deprecated in 000
ArcType Different types of arcs that can be drawn. Added since 0.10.1 Deprecated in 101
BlendAlphaMode Different ways alpha affects color blending. Added since 0.10.0 Deprecated in 100
BlendMode Different ways to do color blending. Added since 0.2.0 Deprecated in 020
CanvasFormat Canvas texture formats. Added since 0.9.0 Deprecated in 090
ColorMode Controls how drawn images are affected by current color. Added since 0.2.0 Removed in 0.9.0
CompareMode Different types of stencil test and depth test comparisons. Added since 0.10.0 Deprecated in 100
CullMode How Mesh geometry is culled when rendering. Added since 11.0 Deprecated in 110
DrawMode Controls whether shapes are drawn as an outline, or filled. Deprecated in 000
FilterMode How the image is filtered when scaling. Deprecated in 000
GraphicsFeature Graphics features that can be checked for with love.graphics.getSupported. Added since 0.8.0 Deprecated in 080
GraphicsLimit Types of system-dependent graphics limits. Added since 0.9.1 Deprecated in 091
IndexDataType Vertex map datatype. Added since 11.0 Deprecated in 110
LineJoin Line join style. Deprecated in 090
LineStyle The styles in which lines are drawn. Deprecated in 000
MeshDrawMode How a Mesh's vertices are used when drawing. Added since 0.9.0 Deprecated in 090
MipmapMode Controls whether a Canvas has mipmaps, and its behaviour when it does. Added since 11.0 Deprecated in 110
PixelFormat Pixel formats for Textures, ImageData, and CompressedImageData. Added since 11.0 Deprecated in 110
PointStyle How points should be drawn. Removed in 0.10.0
SpriteBatchUsage Usage hints for SpriteBatches and Meshes. Added since 0.8.0 Deprecated in 080
StackType Graphics state stack types used with love.graphics.push. Added since 0.9.2 Deprecated in 092
StencilAction How a stencil function modifies the stencil values of pixels it touches. Added since 0.10.0 Deprecated in 100
TextureFormat Controls the canvas texture format. Added since 0.9.0 Removed in 0.10.0
TextureType Types of textures (2D, cubemap, etc.) Added since 11.0 Deprecated in 110
VertexAttributeStep The frequency at which a vertex shader fetches the vertex attribute's data from the Mesh when it's drawn. Added since 11.0 Deprecated in 110
WrapMode How the image wraps inside a large Quad. Deprecated in 000


See Also

Other Languages