You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Showing all colors as an example. Put your sprite bitmap instead
148
+
blitRect(s_pSprite0Data,0, 0, 8, 4, 0);
149
+
blitRect(s_pSprite0Data,0, 4, 8, 4, 1);
150
+
blitRect(s_pSprite0Data,0, 8, 8, 4, 2);
151
+
blitRect(s_pSprite0Data,0, 12, 8, 4, 3);
152
+
blitRect(s_pSprite0Data,0, 16, 8, 4, 4);
153
+
blitRect(s_pSprite0Data,0, 20, 8, 4, 5);
154
+
blitRect(s_pSprite0Data,0, 24, 8, 4, 6);
155
+
blitRect(s_pSprite0Data,0, 28, 8, 4, 7);
156
+
blitRect(s_pSprite0Data,8, 0, 8, 4, 8);
157
+
blitRect(s_pSprite0Data,8, 4, 8, 4, 9);
158
+
blitRect(s_pSprite0Data,8, 8, 8, 4, 10);
159
+
blitRect(s_pSprite0Data,8, 12, 8, 4, 11);
160
+
blitRect(s_pSprite0Data,8, 16,8, 4, 12);
161
+
blitRect(s_pSprite0Data,8, 20, 8, 4, 13);
162
+
blitRect(s_pSprite0Data,8, 24, 8, 4, 14);
163
+
blitRect(s_pSprite0Data,8, 28, 8, 4, 15);
164
+
165
+
s_pSprite0 = spriteAdd(0, s_pSprite0Data);
166
+
```
167
+
Because, a 16 colors sprites use 2 channels, it must be used on an even channel (0,2,4,6). The odd channel just after will be taken by the 16 colors sprite so don't use it. (so 1,3,5,7).
168
+
169
+
You need to use the SetPos functions to set the sprite position :
170
+
```c
171
+
spriteSetPos(s_pSprite0,100,100);
172
+
173
+
spriteSetPosY(s_pSprite0,s_pSprite0->wY-2);
174
+
175
+
spriteSetPosX(s_pSprite0,s_pSprite0->wX-2);
176
+
```
177
+
178
+
`spriteRequestMetadataUpdate` is not needed when you use theses functions.
179
+
180
+
181
+
182
+
**Don't change the position by doing : `s_pSprite0->wX=newvalue`**
183
+
184
+
185
+
For 16 colors sprites, `spriteSetBitmap` is not optimized, don't use it (yet) for animation.
186
+
187
+
## Q&A
188
+
189
+
### My sprite is showing behind the playfield
190
+
191
+
After a view load blcon2 is set to 0, you need to set the blcon2 to what you want.
192
+
193
+
````
194
+
#include <ace/utils/custom.h>
195
+
[...]
196
+
viewLoad(s_pView);
197
+
// To insert after the viewload
198
+
// Update blcon2 to put sprite in front of http://amigadev.elowar.com/read/ADCD_2.1/Hardware_Manual_guide/node0159.html
199
+
g_pCustom->bplcon2=0b00100000;
200
+
```
201
+
136
202
## Managing sprites in a different way
137
203
138
204
It is very much possible that you will find ACE's sprite manager's abilities insufficient (e.g. you want to manage your sprite pointers or data using copperlist).
0 commit comments