LB Booster
« Multiple graphic controls having sprites? »

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



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: Multiple graphic controls having sprites?  (Read 746 times)
datwill
Guest
xx Multiple graphic controls having sprites?
« Thread started on: Feb 3rd, 2015, 09:08am »

I thought I read somewhere in LBB (or it could just be my imagination) that multiple graphic boxes/windows can have sprites. Is this true with LBB?
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Multiple graphic controls having sprites?
« Reply #1 on: Feb 3rd, 2015, 09:46am »

on Feb 3rd, 2015, 09:08am, datwill wrote:
I thought I read somewhere in LBB (or it could just be my imagination) that multiple graphic boxes/windows can have sprites. Is this true with LBB?

I don't think it is. If you attempt to draw sprites in more than one graphicbox/window I expect you will get exactly the same sprites and exactly the same background in both, which is unlikely to be very useful!

Presumably what you are asking for is independent sprites, background etc. for each box/window. That might be possible but it's a lot of work.

Richard.
User IP Logged

datwill
Guest
xx Re: Multiple graphic controls having sprites?
« Reply #2 on: Feb 3rd, 2015, 10:09am »

Don't worry, if it isn't possible I'm not really asking you to add it (I do mean independent/unique sprites for multiple graphic controls), only if you want to! I'm pretty sure I can evade this problem anyway by making multiple apps work together.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Multiple graphic controls having sprites?
« Reply #3 on: Feb 3rd, 2015, 9:57pm »

on Feb 3rd, 2015, 10:09am, datwill wrote:
Don't worry, if it isn't possible I'm not really asking you to add it.

Try this (it uses sprites from the LB examples folder so you should save the program there):

Code:
    nomainwin

    loadbmp "smiley1", "sprites\smiley1.bmp"
    loadbmp "crab1", "sprites\crab1.bmp"
    loadbmp "bg1", "sprites\bg1.bmp"
    loadbmp "bg2", "sprites\bg2.bmp"
    open "sprite window 1" for graphics_nsb as #g1
    UpperLeftX = 100
    open "sprite window 2" for graphics_nsb as #g2
    #g1 "trapclose [quit]"
    #g1 "addsprite smiley1 smiley1"
    #g1 "spritetravelxy smiley1 200 250 1 [landed]"
    #g2 "trapclose [quit]"
    #g2 "addsprite crab1 crab1"
    #g2 "spritetravelxy crab1 200 250 1 [landed]"
    timer 40, [animate]
    wait

[animate]
    #g1 "background bg1"
    #g1 "spritevisible smiley1 on"
    #g2 "spritevisible crab1 off"
    #g1 "drawsprites"
    #g2 "background bg2"
    #g1 "spritevisible smiley1 off"
    #g2 "spritevisible crab1 on"
    #g2 "drawsprites"
    wait

[quit]
    close #g1
    close #g2
    end

[landed]
    wait 

Richard.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Multiple graphic controls having sprites?
« Reply #4 on: May 27th, 2016, 09:28am »

There's currently a thread at the Just BASIC forum discussing a problem arising from attempting to use sprites in two different windows or graphicboxes, which is not supported by JB or LB.

Perhaps this is a good opportunity to point out that, with care, you can use sprites in multiple windows in LBB; this Wiki article describes how. There's an overhead, because it's not a feature I specifically designed for, but it's not too onerous.

Richard.
« Last Edit: May 27th, 2016, 09:29am by Richard Russell » 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