[SOLVED]battle room in gui layout ?

Fabseven

Member
Hello devs,

I am creating a "board" game where you can encounter different events such as "open a treasure", "hunt event","shop" and of course "battle"

While the board is always on the screen (let's say it's drawed on the draw event), the current event is displayed in draw gui event,

Event battle :
battle.png

in another game i have the hero in the center of the view and the camero is following him while he move, i am wondering if it may be easily possible when you draw the "room for battle" yourself in the screen in gui layer ?
Because at the moment i am thinking the "room for battle" is a little tiny !
 

NightFrost

Member
I have never used them myself, but wouldn't this just be a matter of opening a second view and viewport to a section of the room where the battle map is located? Just like you'd clamp the view to your "board" so it never leaves its area, you clamp the view to battle map so it never leaves the room area designated for it. I also don't know whether GMS allows viewports to overlap without issue (and how to set their depths) or if there'd be some undefined behavior when they overlap.
 

Fabseven

Member
hum i didnot understand all your ansker but you mean it may be possible to view 2 views at the same moment ? I will try it.

Readed the doc about view :

GameMaker: Studio permits you 8 independent views (numbered from 0 - 7), all of which can be active at any one time, and all of which can show different parts of the same room. This means that you can use views to draw HUD elements or to have split screen effects for example. Each view also has its own associated view port. If the view is a section of the room that the player can see, the port is the area of the screen on which this view is drawn, and as such you can distort and scale the view if it is a size other than the view port.

I will try it, ty
 

Fabseven

Member
Hello again,
worked fine with two view, just had a little trouble to draw the "surrending" scroll but in the end it was easy TYVM.:)
 
Top