Difference between revisions of "X Media:setPixel"
m (Text replacement - "<source" to "<syntaxhighlight") |
|||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | + | '''Available since:''' Gideros 2016.1<br/> | |
− | ''' | + | '''Class:''' [[Media]]<br/> |
− | ''' | ||
=== Description === | === Description === | ||
Sets r, g, b, a values to pixel at x,y coordinate (RGB are in range of 0 to 255, alpha is in range of 0 to 1). | Sets r, g, b, a values to pixel at x,y coordinate (RGB are in range of 0 to 255, alpha is in range of 0 to 1). | ||
− | < | + | <syntaxhighlight lang="lua"> |
Media:setPixel(x, y, r, g, b, a) | Media:setPixel(x, y, r, g, b, a) | ||
</source> | </source> | ||
Line 13: | Line 12: | ||
'''x''': (number) x pixel coordinate<br/> | '''x''': (number) x pixel coordinate<br/> | ||
'''y''': (number) y pixel coordinate<br/> | '''y''': (number) y pixel coordinate<br/> | ||
− | '''r''': (number) red value between | + | '''r''': (number) red value (between 0 and 255)<br/> |
− | '''g''': (number) green value between | + | '''g''': (number) green value (between 0 and 255)<br/> |
− | '''b''': (number) blue value between | + | '''b''': (number) blue value (between 0 and 255)<br/> |
− | '''a''': (number) alpha value between 0 and 1<br/> | + | '''a''': (number) alpha value (between 0 and 1)<br/> |
+ | |||
+ | ---- | ||
=== Description === | === Description === | ||
Sets hexadecimal color and alpha values to pixel at x,y coordinate (alpha is in range of 0 to 1). | Sets hexadecimal color and alpha values to pixel at x,y coordinate (alpha is in range of 0 to 1). | ||
− | < | + | <syntaxhighlight lang="lua"> |
Media:setPixel(x, y, hex, alpha, blendAlpha) | Media:setPixel(x, y, hex, alpha, blendAlpha) | ||
</source> | </source> | ||
Line 28: | Line 29: | ||
'''y''': (number) y pixel coordinate<br/> | '''y''': (number) y pixel coordinate<br/> | ||
'''hex''': (hexadecimal) hexadecimal color<br/> | '''hex''': (hexadecimal) hexadecimal color<br/> | ||
− | '''alpha''': (number) alpha value between 0 and 1<br/> | + | '''alpha''': (number) alpha value (between 0 and 1)<br/> |
− | '''blendAlpha''': (number) blend alpha value between 0 and 1<br/> | + | '''blendAlpha''': (number) blend alpha value (between 0 and 1)<br/> |
{{Media}} | {{Media}} |
Latest revision as of 14:32, 13 July 2023
Available since: Gideros 2016.1
Class: Media
Description
Sets r, g, b, a values to pixel at x,y coordinate (RGB are in range of 0 to 255, alpha is in range of 0 to 1). <syntaxhighlight lang="lua"> Media:setPixel(x, y, r, g, b, a) </source>
Parameters
x: (number) x pixel coordinate
y: (number) y pixel coordinate
r: (number) red value (between 0 and 255)
g: (number) green value (between 0 and 255)
b: (number) blue value (between 0 and 255)
a: (number) alpha value (between 0 and 1)
Description
Sets hexadecimal color and alpha values to pixel at x,y coordinate (alpha is in range of 0 to 1). <syntaxhighlight lang="lua"> Media:setPixel(x, y, hex, alpha, blendAlpha) </source>
Parameters
x: (number) x pixel coordinate
y: (number) y pixel coordinate
hex: (hexadecimal) hexadecimal color
alpha: (number) alpha value (between 0 and 1)
blendAlpha: (number) blend alpha value (between 0 and 1)
- X Media:copy
- X Media:crop
- X Media:drawFill
- X Media:drawImage
- X Media:drawLine
- X Media:drawText
- X Media:flipHorizontal
- X Media:flipVertical
- X Media:floodFill
- X Media:getHeight
- X Media:getPath
- X Media:getPixel
- X Media:getRotation
- X Media:getWidth
- X Media:resize
- X Media:resizeHeight
- X Media:resizeWidth
- X Media:save
- X Media:setPixel
- X Media:setRotation
- X Media:trim