Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - MOVING OBJECTS

MOVING OBJECTS

Discuss PocketC for CE (including Desktop Edition)

Postby kjm on Thu Mar 15, 2001 5:06 pm

Is it possible to use circle() to draw a ball and have it move across the screen agains a coloured background and if so how?

Or do you have to use drawimage() or drawbitmap() etc.?
kjm
 
Posts: 48
Joined: Wed Mar 07, 2001 4:02 pm
Location: United Kingdom

Postby darwin on Thu Mar 15, 2001 8:10 pm

yes, it is possible: but it is not comfortable:

main () {
int i;
createctrl("static",0,0,0, 0,0,320,240,123); //"remover"
/*...
* draw the background */
keepscreen_off();
for (i=0;i<100;i++)
circle(40,40,100-i); //draw anything you want
wndshow(123,5);
wndshow(123,0);
}

I think that work. You will have to try it out. Justine gave me this tip...

http://www.strange-phenomenom.de/index.php3
darwin
 
Posts: 71
Joined: Tue Dec 05, 2000 12:04 pm
Location: Germany

Postby Justinespinosa on Fri Mar 16, 2001 3:22 pm

It works.
The control is here to say the system that the window needs to be repainted.
But you will need to add a sleep(1) statment after wndshow(,0) to let the system the time to redraw the window.

J.Espinosa

OUTS Softwares
J.Espinosa

OUTS Softwares
Justinespinosa
 
Posts: 156
Joined: Wed Dec 06, 2000 2:30 pm
Location: Switzerland

Postby Justinespinosa on Sat Mar 17, 2001 3:44 pm

I read your mail But my server fails to send the reply. and the other mails i send works. I will continue to try

J.Espinosa

OUTS Softwares

Edited by - justinespinosa on 03/17/2001 09:44:59
J.Espinosa

OUTS Softwares
Justinespinosa
 
Posts: 156
Joined: Wed Dec 06, 2000 2:30 pm
Location: Switzerland

Postby kjm on Wed Mar 21, 2001 6:18 pm

It works - It works not?

I've tried the above and the best I can seem to do is produce a moving ball against a coloured background that leaves a black trail behind it! In fact using circle() with or without createctrl() seems to have no difference? Is it machine dependent or is there something a miss here?
kjm
 
Posts: 48
Joined: Wed Mar 07, 2001 4:02 pm
Location: United Kingdom

Postby airdrik on Wed Mar 21, 2001 7:13 pm

One thing you can do is just re-draw a circle the same color as the background over the previous circle before you draw the new circle.
airdrik
 
Posts: 26
Joined: Fri Feb 09, 2001 3:25 pm

Postby Justinespinosa on Fri Mar 23, 2001 3:22 pm

I think darwin forgot to add that you must switch on keepscreen before using the refresh contorl.

i have written a library that uses this thing correctly. it's a little bit blinking when you moves the objects, but you can try it. I have written in comments in the top of the text how to use it:
http://www.multimania.com/justinespinos ... keepscr.pc

J.Espinosa

OUTS Softwares

Edited by - justinespinosa on 03/23/2001 09:23:30
J.Espinosa

OUTS Softwares
Justinespinosa
 
Posts: 156
Joined: Wed Dec 06, 2000 2:30 pm
Location: Switzerland

Postby Justinespinosa on Sat Mar 24, 2001 6:58 am

Now, i have more time to describe this:

If keepscreen is on. every things drawn on the screen will be kept in a list or in a bitmap. then, when am object comes on top and hide a part of the window. It must be repainted when the object is hidden or deleted and the bitmap of the main window graphics is drawn.
If keepscreen is off. the things are displayed on the screen. But they are not stored in the bitmap. So they are not repainted.

So the cheat is to use keepscreen on to draw the background that is always repainted by the runtime. and keepscreen off to draw the objects that will be erased when the window is repainted. But we musst tell the window to be repainted. And so we use a control that blinks a milisecond on the screen and that tells the window to be repainted.

The library keepscr.pc allows to create objects that are not repainted by the runtime. These objects can be added to a list. and this list is redrawn each time it is modified on a refresh rate you set. The objects are also redrawn when the window must be painted because of an external event.

the following objects are available:

RECT
LINE
CIRCLE
ROUNDRECT
PIXEL
ELLIPSE
TEXT
BITMAP

each object has its own color and properties (such as pen width, pen style, text bk mode, drawbitblt flag )

the objects are stored in a variable called Form.

The whole help is in the top of the file.

Please send me your feedbacks


J.Espinosa

OUTS Softwares
J.Espinosa

OUTS Softwares
Justinespinosa
 
Posts: 156
Joined: Wed Dec 06, 2000 2:30 pm
Location: Switzerland

Postby Justinespinosa on Tue Apr 24, 2001 3:15 pm

If someone tested this library, can you give me a feedback please ?

J.Espinosa

OUTS Softwares
J.Espinosa

OUTS Softwares
Justinespinosa
 
Posts: 156
Joined: Wed Dec 06, 2000 2:30 pm
Location: Switzerland

Postby David on Sat Jun 02, 2001 1:39 pm

To draw a moving circle on the screen,you can also use the following codes:

#define BALLSPEED 3

/*use drawbk() to draw a rectangle(background) on the screen*/
drawbk ()
{
rect(0,0,320,240);
}

/*draw a moving ball*/
main () {
int i;
keepscreen_off();
for (i=0;i<1000;i++)
{
drawbk();//draw the background first
circle(i*BALLSPEED,i*BALLSPEED,20);//put the codes to draw anything you want here
sleep(25);//you may also change the paramater
}
}

I've tried the codes and it works fine.

-David<b></b><b></b>
David
 
Posts: 26
Joined: Sat Jun 02, 2001 1:14 pm


Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 2 guests

cron