DxGetBlendMode: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
Fernando187 (talk | contribs) (Remove obsolete Requirements section) |
||
(8 intermediate revisions by 6 users not shown) | |||
Line 13: | Line 13: | ||
*'''add''' | *'''add''' | ||
*'''modulate_add''' | *'''modulate_add''' | ||
*'''overwrite''' | |||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- Function to draw a rectangle with the current blend mode displayed | |||
function renderBlendModeExample() | |||
-- Get the current blend mode | |||
local blendMode = dxGetBlendMode() | |||
-- Draw a background rectangle | |||
dxDrawRectangle(100, 100, 300, 200, tocolor(0, 0, 255, 100)) | |||
-- Draw some text on top of the rectangle | |||
dxDrawText("Current Blend Mode: " .. blendMode, 110, 110, 390, 190, tocolor(255, 255, 255, 255), 1.5, "default-bold") | |||
end | |||
-- Add an event handler to render the rectangle and text every frame | |||
addEventHandler("onClientRender", root, renderBlendModeExample) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Drawing_functions}} | {{Drawing_functions}} | ||
[[ | |||
[[hu:dxGetBlendMode]] |
Latest revision as of 17:00, 7 November 2024
This function returns the current blend mode for the dxDraw functions. The blend mode is set using dxSetBlendMode
Syntax
string dxGetBlendMode ( )
Returns
Returns the current blend mode, which can be one of:
- blend
- add
- modulate_add
- overwrite
Example
-- Function to draw a rectangle with the current blend mode displayed function renderBlendModeExample() -- Get the current blend mode local blendMode = dxGetBlendMode() -- Draw a background rectangle dxDrawRectangle(100, 100, 300, 200, tocolor(0, 0, 255, 100)) -- Draw some text on top of the rectangle dxDrawText("Current Blend Mode: " .. blendMode, 110, 110, 390, 190, tocolor(255, 255, 255, 255), 1.5, "default-bold") end -- Add an event handler to render the rectangle and text every frame addEventHandler("onClientRender", root, renderBlendModeExample)
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