[prev in list] [next in list] [prev in thread] [next in thread] List: squeak-beginners Subject: Re: [Newbies] Morphic buttons in Laser Game tutorial From: "ina tube" <innertube () doramail ! com> Date: 2007-09-11 1:24:05 Message-ID: 20070911012405.74B5A43AB8 () ws5-1 ! us4 ! outblaze ! com [Download RAW message or body] > > > Hi, > > maybe I can help you find the problem. > Thanks! I appreciate your help. > > When I get to the part where tutorial describes creating the > > 'Fire' and 'Quit' buttons, though, I get an unexpected result. > > The buttons are vastly oversized. > > What do you mean by oversized? Are they still contained in the control > panel morph? A good way to check the embedding of morphs in containers > is to bring up the Halo: first you get the halo of the outer morph, > click again to get the halo of the next embedded morph etc. Another > way is to give different morphs different colors. E.g.: > > panel color: Color blue > > Can you send a screenshot of how these buttons look like? > hope this helps I'm attaching 2 screen captures of the oversized buttons. I've changed the button colors, as you've suggested. In the second screen capture, I've raised the halo. The halo surrounds the Quit button. The Fire button is covered by the Quit button, with only the top portion of the Fire button protruding. As indicated in the tutorial, I use the following commands to attach the buttons. panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. panel addMorph: self makeFireLaserButton fullFrame: (LayoutFrame fractions: (0@0 corner: 1@1) offsets: ( (20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated)) ) ). vertOffsetTop := 10 + buttonHeight. vertOffsetBtm := 10. panel addMorph: self makeQuitGameButton fullFrame: (LayoutFrame fractions: (0@0 corner: 1@1) offsets: ( (20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated)) ) ). ^panel Thanks again, Paul -- _______________________________________________ Get your free email from http://mail.doramail.com Powered by Outblaze ["Picture 1.png" (Picture 1.png)] PNG IHDR ! 1<