Why Does The Text Leave Trails When Shooting For Below Code?


fancellu

Still Fresh
Joined
Nov 9, 2006
Messages
29
Just playing about with below code, what am I doing wrong?
Or is it just a pc artifact? I haven't deployed to my gp2x yet.

---------

program thingy2;
global
score[1];
id1;
id2;
gr_ball;
gr_bullet;

begin
set_title("thingy!!!!!");
full_screen = false;

gr_ball = new_map(10,10,8);
map_clear(0,gr_ball,13);

gr_bullet = new_map(5,5,8);
map_clear(0,gr_bullet,13);

set_mode(m320x240);

x=0;

id1=write(0,0,100,1,"Hello");
SET_TEXT_COLOR(25);
id2=write(0,300,50,1,"Something else");

task();

while (x<320)
//delete_text(0);
x+=1;

MOVE_TEXT(id1,x,100);
Frame 50;
If (Key(_enter)) Return; End
end;

Loop
Frame;
If (Key(_enter)) Return; End
end;


end

Process task()
begin
x = 160;
y = 120;
graph = gr_ball;
loop
If (Key(_right)) x+=1; End
If (Key(_left)) x-=1; End
If (Key(_down)) y+=1; End
If (Key(_up)) y-=1; End
If (Key(_space)) bullet(x,y); End
Frame;
end;
end

Process bullet(myx,myy)
begin
x=myx;
y=myy;
graph = gr_bullet;
while (y>0)

y--;
Frame 15;
end;
end;
 
eh, what is the problem? i compiled it, and see no problem....

When running on pc fxi.exe, if I press the space bar, to fire a bullet I find that the scrolling text sometimes leaves pixels behind.

Another issue, if I deploy to gp2x I just get a blank screen. Any idea why that would be?
 
Last edited by a moderator:
eh, what is the problem? i compiled it, and see no problem....

When running on pc fxi.exe, if I press the space bar, to fire a bullet I find that the scrolling text sometimes leaves pixels behind.

Another issue, if I deploy to gp2x I just get a blank screen. Any idea why that would be?
the left behind pixels are indeed one of the bugs of fenix...
i think using a background image stops it from happening, it only happens on the black background i think.

about the blank screen, dunno, i have no experience in making fenix progs work on the gp2x
 
Last edited by a moderator:
Just playing about with below code, what am I doing wrong?
Or is it just a pc artifact? I haven't deployed to my gp2x yet.

There's a known bug with the move command, it really mucks up if you have other graphics going on. Another way to achieve almost the same effect is to do this instead:

Code:
delete_text(id1);
id1=write(0,x,100,0, "Hello");
Deleteing the text and re-writing it, this usually solves the problem. The only down side is it flickers every so slightly, but most don't notice this.

Regarding the black screen, your code works fine on my GP2X, are you sure you're launching it correctly and with the latest runtime? If not, I can help you there too!

One word of advice, stay away from maps as much as possible, they really slow the GP2X fenix down.
 
Last edited by a moderator:
Can you point me to the latest runtime then?

I used something called fenixb4.zip or some such, came with a few tests, which all ran fine,
then trying my code with edited .gpe, just showed a blank screen.
 
Can you point me to the latest runtime then?

I used something called fenixb4.zip or some such, came with a few tests, which all ran fine,
then trying my code with edited .gpe, just showed a blank screen.
Hi again,

Here you go, you can copy the contents of the zip to a folder on the GP2X and it should work fine. I tested it and it works perfectly on mine :).

Thingy.zip <--- contains runtime etc.

Hope this helps :)

Clare.
 
Last edited by a moderator:
Thanks, that works fine, must be that latest beta.

I tried http://archive.gp2x.de/cgi-bin/cfiles.cgi?0,1,0,0,14,1119 but your beta4 seems newer!

Beta 4 and a half?!

Nice to see my little app running on the intended platform.

Dino.
Glad that worked, and yeah, it's nice to see your own little application running on the GP2X :).

I am still thinking of creating my own mini FAQ for Fenix based on my experiences as a new user. There were a lot of things out there that was almost impossible to find using the present FAQ's and searching the web. I'm thinking along the lines of general how to's and basic code snippets. Lots of which were not found anywhere online, and the official FAQ.pdf presently leaves a LOT to be desired. Also, anything I have written that I think may be useful, I might add them too!
 
Last edited by a moderator:
Back
Top