Screen and Window

BlitzMax Forums/BlitzMax Beginners Area/Screen and Window

Glenn Dodd(Posted 2006) [#1]
In the good old days of BlitzBasic on the Amiga i had a simple game that used a screen and a window.
The screen was bigger than the window.
As i held the right mouse button down i scrolled the window so i could see different parts of the screen.
Actually i think i was scrolling the screen behind the stationary window...

The screen is like a chess board and the window is smaller so i can only see part of the board at any one time.

I can't seem to find the right keywords in the help system to achieve this.

Any help appreciated,
Regards
Glenn


tonyg(Posted 2006) [#2]
setviewport?
You can either scroll the viewport (image remains stationary) or change the drawimage offset (viewport remains stationary). If you have multiple images you can use setorigin to change them all.
Bit clunky...



Glenn Dodd(Posted 2006) [#3]
Cheers. Will have a try and read the docs about it.
Regards
Glenn


Glenn Dodd(Posted 2006) [#4]
I might be asking the wrong questions.
I want a screen (800,600) where a big section is the scrollable map, a smaller section is the mini map, a small section is the statistics view and finally there is a status bar on the bottom.
All this is surrounded by a static border.
From all the stuff above i have got a viewport working for the main scrollable area but still having problems with the other parts. The mini map will change as a character moves. The statistics will update with steps left for this turn. The status bar will change once a turn.

Is there a sample program in the archives that does something similar? I don't know what to start searching for...

I thought all i needed was multiple viewports but i guess i am doing something wrong in the code as the graphics keep overwriting each other.

Regards
Glenn


LarsG(Posted 2006) [#5]
perhaps you're drawing them in the wrong order?
a suggestion is first to draw the backgound and the stuff on it for the big section..
after that, you draw the minimap, the statistics view and the status bar..


tonyg(Posted 2006) [#6]
I added a HUGE response with answers, code etc last night but it must have been zapped by the forum problems.
You might have solved your movemouse stuff but this should help.
Second, try (pseudo)...
   while
      cls
      setviewport 0,0,graphicswidth(),graphicsheight()
      Draw border image
      setviewport x,y,200,200
      draw viewport image
      flip
   wend



Glenn Dodd(Posted 2006) [#7]
Tony - Any chance you can post the huge reply again?
I seem to be doing ok for the moment but it would be useful for any other beginners too.

Cheers
Glenn


tonyg(Posted 2006) [#8]
Sorry Glenn, didn't save them. I *could* do it all again but it'd be quicker for you to post your code.
I do know I got some flickering with Flip 0 but it was OK with flip -1 and 1. I had not timing code though.


Glenn Dodd(Posted 2006) [#9]
Ok.
When i get the basics of the game done i will post the source so people can advise what i should do differently.
Cheers
Glenn