User Tools

Site Tools


development:csdk:2.0:sprites

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
development:csdk:2.0:sprites [2024/11/20 22:03] – created clydedevelopment:csdk:2.0:sprites [2024/11/21 04:59] (current) – [Drawing by rectangle] clyde
Line 50: Line 50:
 =====Drawing by rectangle===== =====Drawing by rectangle=====
  
-Once your graphics are loaded into a sprite bank, you can draw them with ''queue_draw_sprite''+Once your graphics are loaded into a sprite bank, you can draw them with [[development:csdk:2.0:headers:draw_queue#queue_draw_sprite|queue_draw_sprite]]
  
 <code c> <code c>
-queue_draw_sprite(X,Y,W,H,GX,GY,RAMBANK);+queue_draw_sprite(X,Y,W,H,GX,GY,SPRITESLOT);
 </code> </code>
  
-X and Y indicate coordinates on the screen. W and H are the width and height. GX and GY are the coordinates in the source image which you'd use to pick a tile or frame of animation from a sheet. RAMBANK is the ''SpriteSlot'' value returned by ''allocate_sprite'' when you loaded the image data.+X and Y indicate coordinates on the screen. W and H are the width and height. GX and GY are the coordinates in the source image which you'd use to pick a tile or frame of animation from a sheet. SPRITESLOT is the ''SpriteSlot'' value returned by ''allocate_sprite'' when you loaded the image data.
  
 ''queue_draw_sprite'' is part of the queued drawing API, so you can consecutively call other queued drawing functions and they'll be processed one at a time, in order. ''queue_draw_sprite'' is part of the queued drawing API, so you can consecutively call other queued drawing functions and they'll be processed one at a time, in order.
Line 64: Line 64:
 =====Drawing by frame number===== =====Drawing by frame number=====
  
-If you've exported a packed sprite sheet alongside JSON frame data, you can use ''queue_draw_sprite_frame''. This function can not only select the rectangle in your sprite sheet from a frame number, it also centers your sprite on the canvas center used in Aseprite and had a parameter for flipping horizontally and/or vertically.+If you've [[development:aseprite##using_the_sdk|exported a packed sprite sheet alongside JSON frame data]], you can use ''queue_draw_sprite_frame''. This function can not only select the rectangle in your sprite sheet from a frame number, it also centers your sprite on the canvas center used in Aseprite and had a parameter for flipping horizontally and/or vertically.
  
 <code c> <code c>
development/csdk/2.0/sprites.1732140187.txt.gz · Last modified: 2024/11/20 22:03 by clyde