Archived

This topic is now archived and is closed to further replies.

Luhar

Anybody interested in a VB.Net scroller?

Recommended Posts

Luhar    122
I''ve got some preliminary work done on a top-down VB.Net scrolling tilemap control. It''s pretty basic right now. I''ve got it to display a bunch of random tiles on a form. The control has scrollbars to scroll across and down the map. The user can spin the mouse wheel to zoom in and out. The map can be displayed with or without gridlines and row and column headers for debugging purposes. I wanted to use GDI+ to do the drawing, but it''s just way too slow, so I opted for good ol'' GDI BitBlt. First, I determine which tiles will be painted based on the size of the control''s client area, current zoom factor, and scrolled location. I blit all the visible tiles to a back buffer, then I paint the backbuffer to the control''s client area using GDI+ and a transformation matrix. It''s a fairly decent tradeoff between the speed of GDI and the nice interpolation effects of GDI+. I did this mainly as an exercise to see if I could create a decent scroller without hardware acceleration. I''ll probably end up using DirectX eventually, but I''d really like to optimize the current non-DX version as sort of a mental exercise. If you''d like to take a look at what I''ve got, possibly suggest ways of optimizing it, or you''re just curious, let me know and I''ll send you my source code. I think some of the code is needlessly complex and I''m hoping a fresh pair of eyes will help me figure out how to tighten it up. You''ll need Visual Basic.Net or the .Net framework installed to use it, though. Features I''d like implement: - Optimize with ScrollDC - Isometric and Hex maps - Multiple layers (I''ve got some ideas on implementing object layers) Thanks, Luhar

Share this post


Link to post
Share on other sites
Zorbfish    214
I''d be interested, although I use C++.net I can follow VB quite well. I''ll take a look at it: stryker777_@_hotmail_._com (remove underscores) Maybe I can do a port of it in C++.

Share this post


Link to post
Share on other sites