SetBlendMode

Syntax

Parameters

Example

--Create a window
local window = Window:Create()

--Create a rendering context
local context = Context:Create(window)

while true do
local context = Context:GetCurrent()
local window = context:GetWindow()

if (window:Closed() or window:KeyDown(Key.Escape)) then return false end

context:SetColor(0.5,0.5,0.5)
context:Clear()

context:SetColor(0,0,1,0.5)

context:SetBlendMode(Blend.Solid)
context:DrawRect(50,50,200,200)

context:SetBlendMode(Blend.Alpha)
context:DrawRect(50+250,50,200,200)

context:SetBlendMode(Blend.Light)
context:DrawRect(50+250*2,50,200,200)

context:SetBlendMode(Blend.Shade)
context:DrawRect(50+250*3,50,200,200)

context:Sync()
end