Scrollbar probleem . Can anyone help me ? lazarus / 10-Designer ---------------------------------------------------------------------- GoDxNero · 2010-06-09 02:24 Im trying to make a simple game, like mario. So I made a large background and put it in the form. This is suppose to move to left or right when the player walk just like in mario. However because its length is to big, I got this annoying horizon scrollbar and cant get rid of it. Any solution to my probleem ? Can I get rid of this scrollbar ? Or is there anyother way to make the idea possible ? (without those scrollbars) ---------------------------------------------------------------------- Leledumbo · 2010-06-09 05:39 In games usually only visible part is drawn. AFAIK, you can't do this with GUI, because if you set scrollbars' Visible property to false, then you won't be able to scroll at all. ---------------------------------------------------------------------- GoDxNero · 2010-06-09 10:05 So I cant make a game where my character is able to move around in a large screen than the TForm self in Lazarus ? like in this game Oo http://www.bbc.co.uk/leicester/secret_level/2004/04/images/pokemon_rub y_270.jpg Besides, I dont need scrollbar in the game at all. So remove it would be ok. ---------------------------------------------------------------------- Martin_fr · 2010-06-09 13:18 First, there are a few libraries/ toollkits, targeted at writing games => I don't recall the names... Using the default/normal drawing routines, may sometimes be to slow. I do recommend to draw the background yourself, using OnPaint, then you can just copy the correct part of the image. ---------------------------------------------------------------------- GoDxNero · 2010-06-09 14:31 Yes I did exact same thing. the image is just to big... when I put it all the way to the left side, no scrollbar. but when it come accross the right side or bottom i get that annoying scrollbar... ---------------------------------------------------------------------- theo · 2010-06-09 14:45 Quote from: GoDxNero on June 09, 2010, 04:31:39 pmSo I made a large background and put it in the form. Quote from: GoDxNero on June 09, 2010, 04:31:39 pmthe image is just to big... What kind of components are these? ---------------------------------------------------------------------- GoDxNero · 2010-06-09 14:56 I put them in Timage. When the Timage get bigger than the TForm the scrollbar will appear. How to disable these ? ---------------------------------------------------------------------- Martin_fr · 2010-06-09 14:57 Quote from: GoDxNero on June 09, 2010, 04:31:39 pmthe image is just to big... It doesn't matter how big the image is. You only ever copy as much of the image as fits on the form. If the form is 100x100 pixel, then you copy 100x100 pixels of the image. If the form is 1000x800 pixel, then you copy 1000x800 pixels of the image. .... Your app should know which part of the image to copy. It may copy from the very top/ very left, or it may copy any part from somewhere in the middle of the image. The real problem is speed... That's why I said look for a toolkit. Otherwise read up on the paint-event, Invalidate(-Rect) and ScrollWindowEx. ---------------------------------------------------------------------- GoDxNero · 2010-06-09 15:04 can you move the picture inside the TImage freely to four directions ? I got a picture which is bigger than the TImage Srry for newbie question but, what are toolkits ? And how do you use it ? Perhaps someone can links me to somewhere to learn the few bassics >< ---------------------------------------------------------------------- Martin_fr · 2010-06-09 15:16 look at the graphics unit, and the methods an TCanvas (most controls have a canvas) There is stuff like CopyRect => it just copies a part of the image. I wouldn't use a TImage. It will slow things down. Capture the Forms OnPaint, and paint directly on the Canvas of the form. But beware => you are only allowed to draw inside the paint event. If your app wants something drawn, you invalidate that part of the form (or the whole form), and do the painting inside the paint-event. sorry, that is all a bit short, more like pointers into a direction. Haven't got time for a full explanation right now ---------------------------------------------------------------------- theo · 2010-06-09 15:19 http://wiki.lazarus.freepascal.org/Developing_with_Graphics#Create_a_c ustom_control_which_draws_itself http://andorra.sourceforge.net/ http://allegro-pas.sourceforge.net/ etc.