?
Solved

DirectX - How to use Windows scrollbars w/ DX?

Posted on 2004-07-31
3
Medium Priority
?
1,121 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
[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
3 Comments
 
LVL 17

Accepted Solution

by:
davebytes earned 500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

765 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