LB Booster
« Undrawing a circle »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:55am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Undrawing a circle  (Read 258 times)
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Undrawing a circle
« Thread started on: Apr 18th, 2015, 9:35pm »

LBB does not have graphics segments, but the flush and redraw commands can still be put to good use. For example in this program (adapted from one posted to the LB forum by Anatoly) they are used in combination to 'undraw' a graphics object:

Code:
nomainwin

open "click to clear circle" for graphics_nsb_nf as #gr
#gr "trapclose [quit]"
#gr "down"

'draw some stuff
randomize .5
for i =1 to 10
    x=rnd(1)*200
    y=rnd(1)*200
    #gr "place ";x;" "; y
    #gr "box ";x+rnd(1)*100;" "; y+rnd(1)*100
next

'copy graphics
#gr "flush"
'draw circle
#gr "place 150 150; circle 100"

'set event handler
#gr "when leftButtonDown [clear1]"
wait

[clear1]
'restore graphics
#gr "redraw"

'set event handler off
#gr "when leftButtonDown"
wait

[quit]
close #gr
end 

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls