Hi,
I started coding to PSP near the christmas by first borrowing some C-programming books from my library, and then I read all Yealdarb's programming tutorials, so I know a little bit of coding now.
But for now, I'd like to see some graphical samples, like making a bouncing ball or box to the screen (Just like the one in the msgdialog-sample of PSP-SDK, but without those dialogs)
Also, I'd like to know how could I make those text lines which I printed with "pspDebugScreenPrintf" command to bounce/scroll over the scree?
Thanks already for all your answers, hopefully somebody knows where to find graphical samples and how to make that text bounce/scroll :)
Cheers,
Mika-
Graphic tutorials?
basically for things like moving text, you cannot use printf, you woulld need to use the function that Brad gives you in one of his tutorials, its
to make that text move around, just put it in a for loop,
make an x and y integer
then make a char
now put text into the char
then print your text
(make sure you have a rgb color for that command, hence i used black) then simply add one to x and y everytime it loops
then of course close your for loop and what not, i'm not going to walk you through bounding it off the walls as you can probably figure it out from there, if not there are plenty of animation tutorials on the web. hope this kinda helps.
Code: Select all
printTextScreen(x, y, char, color);
Code: Select all
for(;;) {
Code: Select all
int x = 10;
int y = 50;
Code: Select all
char thistext[50];
Code: Select all
sprintf(thistext, "Bouncing text test");
Code: Select all
printTextScreen(x, y, thistext, black);
Code: Select all
x++;
y++;
Actually, that helped a lot, thanks! :)Koba wrote:basically for things like moving text, you cannot use printf, you woulld need to use the function that Brad gives you in one of his tutorials
EDIT:
Could you give me a link to those animation tutorials, I was trying to google them but I got nothing :( Thanks already if you can!Koba wrote:if not there are plenty of animation tutorials on the web
Simply make an array of Image pointers and blit the first one, then just increase the array element number by 1 and the next image will blit, making an animation if timed right to not go too fast or slow.
animation with 3 images
That should work, but I did leave out some basic Image Loading functions, so just place them in there as I am tired right now and dont have the energy to.
animation with 3 images
Code: Select all
Image* array[3];
array[0] = loadImage("image.png");
array[1] = loadImage("image2.png");
array[2] = loadImage("image3.png");
// ALL THE OTHER IMAGE BLITTING OPERATIONS GO HERE //
int x = 0;
int i;
while(1) {
blitAlphaImageToScreen(0, 0, 480, 272, array[x], 0, 0);
for(i=0; i<10; i++) x++;
}