Results 1 to 3 of 3

Thread: RTS Game Example viewable area

  1. #1
    Join Date
    Mar 2013

    Default RTS Game Example viewable area

    I am trying to expand upon the RTS Game example. I am trying to figure out how to make the "camera" show a subset of the map. Instead of compressing or stretching the map background to the current window, I want to pan around the map only showing a subarea. See the image below:

    Name:  background.png
Views: 24
Size:  485.4 KB

    So if you imagine that the blue highlight area is the only visible portion of the background. Then I want to add logic that if the cursor hits the edge of the screen, I will move the viewable area.

  2. #2
    Join Date
    Mar 2013


    I think I understand enough about textures to fill up a "map" and I am experimenting with one large texture that is much larger than my viewable area. However, I'm not sure how I would change the "view port" or area of the texture that I can see.


    The closest thing that I have come up with is translating the CL_GraphicsContext. The immediate downside I see is that the cursor position isn't translated for clicking on sprites.


    Resolved the cursor position by doing some translations from screen to "world" positioning. I seem to have issues with the "fog of war affect" I must be failing to push or pop the matrix at the right time.
    Last edited by Casey Abernathey; 03-19-2013 at 04:26 AM.

  3. #3
    Join Date
    Mar 2013


    Hi there, you need a camera class I believe. Take a look at mine and see if you can make some sense of it. Good luck!

Similar Threads

  1. Training area
    By ALien BBQ in forum Tanked
    Replies: 11
    Last Post: 03-17-2013, 04:17 PM
  2. Proton SDK Forum area opened
    By Seth in forum Proton SDK
    Replies: 0
    Last Post: 10-27-2010, 12:28 PM
  3. Some unfinished Area in real Dinksmall wood
    By himel in forum Dink Smallwood HD
    Replies: 5
    Last Post: 08-25-2008, 11:02 PM
  4. Particles from a line or area?
    By CheshireWhiskers in forum Novashell Game Creation System
    Replies: 4
    Last Post: 05-18-2008, 04:07 PM
  5. windemer. Enter in the duck idol area
    By mnunezs in forum Dink Smallwood HD
    Replies: 5
    Last Post: 08-29-2004, 08:40 AM



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts