Solved

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

Posted on 2006-06-23
1
424 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 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Any clean Java Swing double buffering advice? 10 254
Can anybody center this unfinished Death Star for me? 6 158
GPU processing of c++ library 7 126
Fix45 challenge 15 160
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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 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