Re: Pretend example problem
- Posted by don cole <doncole at pacbell.net> Oct 13, 2006
- 483 views
Derek Parnell wrote: > > don cole wrote: > > > > Greg Haberek wrote: > > > > > > Later in the code, the Pixmap 'Buffer' is being blitted to the entire > > > screen. > > > > > > On 10/12/06, don cole <guest at rapideuphoria.com> wrote: > > > > > > > > > > > > posted by: don cole <doncole at pacbell.net> > > > > > > > > > > > > Hello everyone. > > > > > > > > In the Pretend.exw example from Win32lib I attempted to add a > > > > PushButton. > > > > > > > > > > > > > > > > ----------------------------------------------------------------------------- > > > > -- the gui > > > > constant > > > > Win = create( Window, "Pretender", 0, Default, Default, WinWide, > > > > WinHigh+26, 0 ), > > > > Buffer = create( Pixmap, "", 0, 0, 0, WinWide, WinHigh, 0 ) > > > > > > > > constant PushBu8utton3 = create( PushButton, "Hello", Win, 10, 10, 148, > > > > 20, > > > > 0) > > > > > > > > ----------------------------------------------------------------------------- > > > > But it does not show up on screen. anyone know why? > > > > Don Cole > > > > > > > > > > Thank you Greg, > > > > So to make the pushButton show up on every tick one must Cut a hole in the > > buffer > > at that point. Or what? > > > > I appreciate your help > > > > I don't think it's a good idea to have the button overlay the playing area so > I'd place it outisde the playfield. For example, if I put it above the > playfield,... > > > (a) Add this line after the line 'sequence mountains' > > integer PlayfieldTop > > (b) at the beginning of the 'initialize' routine enter these four lines ... > > sequence btnsize > > btnsize = getRect(Btn) > PlayfieldTop = btnsize[2] + btnsize[4] > setClientRect(Win, WinWide, WinHigh + PlayfieldTop) > > (c) Replace the two copyBlt() lines with ... > > copyBlt( Win, 0, PlayfieldTop, Buffer ) > > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell Thank you Derek and Greg, What I am really tring to do is place a button in a window with a constantly moving pixmap. (not a game). I will try Dereks idea of putting a smaller pixmap in the window and Greg's idea of putting the button below the pixmap. I haven't tried anything yet as I just got home from work and just read your posts. I'm tired now and will do it later but I don't see any reason it won't work. Thanks again, Don Cole