Solved

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

Posted on 2006-06-23
1
418 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
1 Comment
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now