?
Solved

Design of a tile editor ... DX doesn't seem to work

Posted on 2006-06-23
1
Medium Priority
?
428 Views
Last Modified: 2010-04-07
Hello,

I started writing a tile/map editor a few days ago. Since then, i've had to retry different methods of an engine because I keep running into different problems.

The game will be in C#/DX.

I want each map to be larger than the size of one screen and scroll when you walk on it. (Like Zelda 3)

So in my first attempt at an editor I set up a container panel on my form roughly the same size as the form. Then I attached my map panel to the container panel and set its dimensions to 5000x5000. That way I can use scrollbars to scroll around on my map and place tiles anywhere I want. I was creating new picturebox instances for each tile laid. Due to some limitations of the pictureboxes (couldn't have transparencies and do layered images when multiple pictureboxes overlapped)

My second attempt at the editor was similar to the first. I had a container panel on my form roughly the size of the form. Next, I created a map panel (5000x5000) and attached it to the container panel. That way I could scroll around with scrollbars in the map. This time however, I am using DirectX. So I created a Device and attached it to my map panel (5000,5000). This is where the program crashes. If I make the dimensions of my panel 4000,4000 DX doesn't complain.

Any techniques anyone can think of where I can have a large map I scroll around on and lay sprites anywhere I want? This is starting to get annoying. Once the Map windows is set up and working fine I can fly through the rest of the engine.

Thanks in advance for any helpful posts.
0
Comment
Question by:ThankYouDriveThrough
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 1000 total points
ID: 16986149
Setup a 2D array (or some other structure) to hold the tiles (or an "index" to the tile that should be in each location).

In the Paint() event of your Panel, iterate the strucutre and draw each tile in the correct location using Graphics.DrawImage().

You can speed things up by only drawing the visible portion of the map.  This can be determined by using information from the AutoScroll() position of your panel and the Panels current width/height...
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question