Question Make a panel like a FP Camera

LacksdaSKILLZ

Member
Joined
Sep 27, 2012
Messages
6
Programming Experience
Beginner
I have a form with a panel. I'd like the form display to follow the panel like a 1st person camera. In 2D. I am not using D3D Just GDI+ and regular imports.

I am using VB.NET so please help.

Right now I have made it that the form width is the same as the panel width.
 
I'd like the form display to follow the panel like a 1st person camera.

That doesn't really make sense. Can you please provide a FULL and CLEAR explanation of what you're trying to achieve?
 
That doesn't really make sense. Can you please provide a FULL and CLEAR explanation of what you're trying to achieve?

I have a panel as shown in the picture below

I want it to move when the character moves like a camera. But I want the form view to change to. Like you see in the build below the project designer it only shows where the panel is. When the panel moves right I want the form to move with the panel. Like a camera. So it works like a first person camera. Will help a lot with sidescrollers in vb.net.

Ty in advance

Untitled-13.gif
 
So you want your game world to remain stationery relative to the screen and you want the form to move around the screen, correct? Is your game world only as big as your monitor?
 
OK so the form is the size as the top part of the image example I showed. I want the panel to move left, when I press the left key, right when I press the right key and i want the form to always display whats in the panel not whats around it and i always want the form to stay the same size as the panel and location as it. like a camera when i move left it will and when i move right it will.
 
I'm afraid that you're still not making complete sense. If you walk down the street, would you say that your clothes are moving? I think that most people would say that they are moving but their clothes are staying where they are, so the clothes are considered relative to the person wearing them, not the world. In this case you're talking about moving the Panel but the Panel isn't going to move at all. It's going to stay right where it is and the form is what's going to move. For instance, the content in the Panel would move X to the left and the form would move X to the right while the Panel would stay exactly where it is, relative to the form. Isn't that the case? This is what I'm talking about when I say FULL and CLEAR. If you've provided a FULL and CLEAR explanation then we shouldn't have to interpret or assume anything.
 
OK here is every detail.

You have a form. Its lets say 600 pixels long.

You want the player to only see 200 pixels long of it. So thats what my panel is. Its the bounds in which the player can see. The form is resized to be around the panel. Now. When the player moves to the right the panel moves to the right and vice versa. So its like a camera in a way. For example. If I have a large scene. I dont want the player to see everything. I want when they move right the camera moves with them so they can see whats off the screen. So heres some more pictorial examples:

I just photoshopped this so I am trying to get the same effect in program that wherever the panel is I only see whats in those bounds.

test.jpg

I hope you understand now.
 
You really need to understand the terminology you're using, especially when you're asking for help with a project. Forms and Panels are both already used in Visual Basic and you're using the terms incorrectly.

At best, judging by your images, you're using two forms. You'll never have a "panel that moves", you'll have a panel that displays the visible portion of your game world (which is exactly what jmcilhinney was trying to help you work out). Why you show your whole world in a separate form is a mystery and only causes confusion.

A slightly better term to use for your game form/panel is a view or viewport - you are creating a view of your world based on your character position. You should be able to easily calculate the co-ordinates of the current view, then render that in your viewport.
 
Back
Top