Solved

DirectX - How to use Windows scrollbars w/ DX?

Posted on 2004-07-31
3
1,115 Views
Last Modified: 2013-12-26
Hello All -

I'm working on a "traditional" board game style, map based, strategy game.  Developing w/ VC++ & DirectX.  I have an image representing the game board and want to display it in the client window area of a windowed (not full screen) app.  I can get the image to show up, but can't figure out how to get the image (which is larger than the window size) to scroll in response to scroll bars.  I don't want to have to "compute" the new window view area each time I scroll if I don't have to.  Anyone have tips / tutorials on how to do this?  I've read a lot of the online tutorials that go as far as "and there's your sphere on the screen", but don't really discuss how to integrate the UI functionailty with the DirectX object's appearance/behavior.

Thanks,
 
- Jason
0
Comment
Question by:jsoloff
3 Comments
 
LVL 17

Accepted Solution

by:
davebytes earned 125 total points
ID: 11726786
I'd start with getting it to respond to say arrow-keys, for panning the board properly, and keeping track of what area is currently visible.  You need to shift the viewport every frame while an arrow key is held, some given amount.

If you can do that, then 'attaching' to the scrollbars is really tracking events from the scrollbars, and mapping them into panning the board to the matching position.  Yes, you do it either every frame while the scrollbar is changing, or when the scroll thumb is released (though live-dragging should be simple at that point).

-d
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ckserve 7 182
RTS server listeners separate Threads, or one Listener? 20 167
Python chess DS needs help 2 157
CreateJS - animation being used is last one assigned 4 129
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.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

805 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