DxSetTextureEdge: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (→Example) |
||
Line 17: | Line 17: | ||
==Example== | ==Example== | ||
The following | The following example draws the image above ingame. | ||
<section show="true" name="Client" class="client"> | <section show="true" name="Client" class="client"> | ||
<syntaxhighlight lang="lua">local renderTarget1 = dxCreateScreenSource(300, 300) | <syntaxhighlight lang="lua">local renderTarget1 = dxCreateScreenSource(300, 300) | ||
Line 30: | Line 30: | ||
addEventHandler("onClientRender", root, | addEventHandler("onClientRender", root, | ||
function() | function() | ||
-- Update the screen | -- Update the screen sources | ||
dxUpdateScreenSource(renderTarget1) | dxUpdateScreenSource(renderTarget1) | ||
dxUpdateScreenSource(renderTarget2) | dxUpdateScreenSource(renderTarget2) | ||
Line 36: | Line 36: | ||
dxUpdateScreenSource(renderTarget4) | dxUpdateScreenSource(renderTarget4) | ||
-- Draw screen | -- Draw screen sources in different modes | ||
dxDrawImageSection(20, 200, 300, 300, -50, 0, 100, 100, renderTarget1) | dxDrawImageSection(20, 200, 300, 300, -50, 0, 100, 100, renderTarget1) | ||
dxDrawImageSection(350, 200, 300, 300, -50, 0, 100, 100, renderTarget2) | dxDrawImageSection(350, 200, 300, 300, -50, 0, 100, 100, renderTarget2) |
Revision as of 14:59, 24 February 2014
Syntax
bool dxSetTextureEdge ( texture theTexture, string textureEdge [, int border-color] )
Required Arguments
- theTexture: The affected texture
- textureEdge: The texture edge mode. Available modes are wrap, mirror, clamp, border, mirror-once
Optional Arguments
- border-color: If textureEdge is set to border, you are able to define a border color here
Example
The following example draws the image above ingame.
Click to collapse [-]
Clientlocal renderTarget1 = dxCreateScreenSource(300, 300) dxSetTextureEdge(renderTarget1, "wrap") local renderTarget2 = dxCreateScreenSource(300, 300) dxSetTextureEdge(renderTarget2, "mirror") local renderTarget3 = dxCreateScreenSource(300, 300) dxSetTextureEdge(renderTarget3, "clamp") local renderTarget4 = dxCreateScreenSource(300, 300) dxSetTextureEdge(renderTarget4, "border", tocolor(255, 0, 0)) addEventHandler("onClientRender", root, function() -- Update the screen sources dxUpdateScreenSource(renderTarget1) dxUpdateScreenSource(renderTarget2) dxUpdateScreenSource(renderTarget3) dxUpdateScreenSource(renderTarget4) -- Draw screen sources in different modes dxDrawImageSection(20, 200, 300, 300, -50, 0, 100, 100, renderTarget1) dxDrawImageSection(350, 200, 300, 300, -50, 0, 100, 100, renderTarget2) dxDrawImageSection(680, 200, 300, 300, -50, 0, 100, 100, renderTarget3) dxDrawImageSection(1010, 200, 300, 300, -50, 0, 100, 100, renderTarget4) end )
See Also
- dxConvertPixels
- dxCreateFont
- dxCreateRenderTarget
- dxCreateScreenSource
- dxCreateShader
- dxCreateTexture
- dxDrawCircle
- dxDrawImage
- dxDrawImageSection
- dxDrawLine
- dxDrawLine3D
- dxDrawMaterialLine3D
- dxDrawMaterialPrimitive
- dxDrawMaterialPrimitive3D
- dxDrawMaterialSectionLine3D
- dxDrawPrimitive
- dxDrawPrimitive3D
- dxDrawRectangle
- dxDrawText
- dxDrawWiredSphere
- dxGetBlendMode
- dxGetFontHeight
- dxGetMaterialSize
- dxGetPixelColor
- dxGetPixelsSize
- dxGetPixelsFormat
- dxGetStatus
- dxGetTextSize
- dxGetTextWidth
- dxGetTexturePixels
- dxIsAspectRatioAdjustmentEnabled
- dxSetAspectRatioAdjustmentEnabled
- dxSetBlendMode
- dxSetPixelColor
- dxSetRenderTarget
- dxSetShaderValue
- dxSetShaderTessellation
- dxSetShaderTransform
- dxSetTestMode
- dxSetTextureEdge
- dxSetTexturePixels
- dxUpdateScreenSource