Jump to content
  • Advertisement
Sign in to follow this  
noirone

need some help with windows forms coordinates please!

This topic is 3075 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, So I'm trying to make an editor for a 2d game using tiles/blocks...a level editor...thought this part was going to be easy..turns out I don't know jack about windows forms and how Microsoft has things set up, I'm using XNA btw, which, makes things very easy and much less time consuming if you are lacking in the framework detail know how...any way, my problem is that I can't for now, do two things. (One)I don't know why if you draw an image to the screen in a windows form at say location 200X by 200Y then when you scroll down much lower using the autoscrollbar and then redraw...the image still pops up at 200X by 200Y (of the form)...even though I've scrolled down or away much lower, I thought I'd be moving away from 200X by 200Y if I used the scrollbar vertically. Basically what I'm aiming for is a program that lets me lay out certain types of images anywhere inside a windows form so that I can see beforehand what the "level" will look like, but I'm having this scrollbar issue right now and I'm stuck...also(two) I can't seem to get a mouseMove event going using s splitcontainer but in form1...my only form...its works, the framework autogenerates the code for me and I just edit it, but when I try to swap in a splitContainer_Panel2 object instead of a form1 object the mouse events don't work but throw no errors...I'm lost on this, please any help would MUCH be appreciated.

Share this post


Link to post
Share on other sites
Advertisement
I've thought of a work around that may work...I really thought that when you scrolled down using scrollbars, the in-window coordinates would change and not stay the same..seems the objects inside the window themselves move but the coordinates stay the same?

Share this post


Link to post
Share on other sites
Quote:
Original post by noirone
nah...ill just take it that no one knows, or has the time..its ok though.


I don't want to be blunt, but I doubt that, and bet you could get more input and actual readers by increasing the readability of your post.

Share this post


Link to post
Share on other sites
The AutoScroll-logic and the ScrollBars of a ScrollableControl are for positioning the child controls. When manually drawing, i.e. through the Paint event handler, this scroll-offset will be ignored (origin will stay at the top left of your control). You can either offset all your drawing calls by the scroll-offset or set the Graphics.Transform properly prior to your draw calls.

Hope that helps.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!