Draw a pixel: Difference between revisions
Content added Content deleted
(Added Robotic implementation to Draw a pixel) |
|||
Line 1,202: | Line 1,202: | ||
Output image: |
Output image: |
||
[https://www.dropbox.com/s/gbtrkx7bx7hogxm/PixelColor.jpg?dl=0 Draw a pixel] |
[https://www.dropbox.com/s/gbtrkx7bx7hogxm/PixelColor.jpg?dl=0 Draw a pixel] |
||
=={{header|Robotic}}== |
|||
We can technically draw a pixel through the uses of Sprites. |
|||
One of the requirements (fixed screen resolution) could not be met. |
|||
<lang robotic> |
|||
. "Set the sprite's reference character located at the" |
|||
. "upper-left corner of the board (char 0)" |
|||
set "SPR0_REFX" to 0 |
|||
set "SPR0_REFY" to 0 |
|||
. "Offset that reference by 256, leading to the first character" |
|||
. "in the extended character set" |
|||
set "SPR0_OFFSET" to 256 |
|||
. "Set the width and height of the sprite" |
|||
set "SPR0_WIDTH" to 1 |
|||
set "SPR0_HEIGHT" to 1 |
|||
. "Unbound the sprite, removing the grid restriction" |
|||
set "SPR0_UNBOUND" to 1 |
|||
. "Display the sprite on the overlay (this may not be necessary)" |
|||
set "SPR0_OVERLAY" to 1 |
|||
set "xPos" to 100 |
|||
set "yPos" to 100 |
|||
put c0c Sprite p00 at "('xPos')" "('yPos')" |
|||
</lang> |
|||
I highly recommend you check out [https://www.digitalmzx.net/wiki/index.php?title=Sprite_(Tutorial) this tutorial] for the usage of Sprites in order to get a better understanding of all this. |
|||
=={{header|Rust}}== |
=={{header|Rust}}== |