Draft: Lua image lib
Merge !2104 (merged) first.
Documentation:
Adds: image.create
, image.patchExists
(might rename), image.getPatch
(might rename), image.getSpritePatch
(might rename), image.getSprite2Patch
(might rename)
Function | Parameters | Description | Returns |
---|---|---|---|
image.create |
width, height, [format] |
Creates a patch. format is one of: palette , rgba . Default is palette . |
patch |
image.patchExists |
name |
See v.patchExists
|
boolean |
image.getPatch |
name |
See v.cachePatch
|
patch |
image.getSpritePatch |
sprite, [frame, [rotation, [rollangle]]] |
See v.getSpritePatch
|
patch, boolean |
image.getSprite2Patch |
skin, sprite2, [super?], [frame, [rotation, [rollangle]]] |
See v.getSprite2Patch
|
patch, boolean |
Adds to patch
: is_editable
, patch:getPixel
, patch:setPixel
(might remove), patch:copy
, patch:clear
Field | Parameters | Description | Returns |
---|---|---|---|
patch.is_editable |
- | Whether the patch can be edited. | boolean |
patch:getPixel |
x, y |
Gets a palette index or RGBA color at x, y . Returns nil on a paletted patch if there is no pixel at x, y
|
number or nil |
patch:setPixel |
x, y, color |
Sets the pixel at x, y
|
- |
patch:copy |
table, [width, [height, [source_x, [source_y, [source_w, [source_h, [destination_x, [destination_y, [copy_transparent, use_pixel_alpha]]]]]]]]]] OR patch, [source_x, [source_y, [source_w, [source_h, [destination_x, [destination_y, [copy_transparent, use_pixel_alpha]]]]]]]]
|
Copies pixels from a patch or a table from coordinates source_x , source_y sized source_w , source_h into destination_x , destination_y . If the pixels copied originate from a table, the color format must match that of the destination. copy_transparent will copy any transparent pixels from the source, overwriting any opaque pixels. use_pixel_alpha will perform alpha blending on the source pixels that are transparent with the destination pixels (RGBA source only.) |
- |
Merge request reports
Activity
added Changed behavior Discussion Documentation Enhancement Feature Lua Refactoring Rendering labels
mentioned in merge request !2203
added Unmergeable label
requested review from @LoganAir
changed milestone to %2.2.14
You did hear from me about this a while ago, but reposting here to keep things findable
When you start this lua script with opengl, images don't load. But when you switch to software its all normal and its still normal when you switch back.
added 1059 commits
-
d8d2371d...32a8652c - 1057 commits from branch
next
- 122b1c70 - Merge branch 'next' into lua-gfx-2
- 3bee12cb - fix HWR_DrawPatchInCache()
-
d8d2371d...32a8652c - 1057 commits from branch
removed Unmergeable label
added 1 commit
- a1a0f4c2 - HWR_DrawPatchInCache(): remove cast and pointer for block
changed milestone to %2.2.15
changed milestone to %2.2.16
changed milestone to %2.3