Solved

DirectX - How to use Windows scrollbars w/ DX?

Posted on 2004-07-31
3
1,109 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Delphi: Screenshot opengl game full screen 36 1,944
candy crush 4 423
sudoku - is there a Maths to solving a puzzle? 6 288
count7 challenge 12 70
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…
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

11 Experts available now in Live!

Get 1:1 Help Now