[SOLVED] dividing a view

Hey! Im having problems dividing a view.
I want to do in Draw Event:
GML:
view_xview[0] + 16, view_yview[0] / 2
so that it draws the text always in the middle of the view vertically.
And then so that there are three lines of dialogue on top of one another, I want to reduce their y-var so they stack, like:

Code:
view_xview[0]+16, view_yview[0]/2 - 16
view_xview[0]+16, view_yview[0]/2
view_xview[0]+16, view_yview[0]/2 + 16
but that doesnt work (as i expected). How do I mark the dividing and reducing correctly?
 
Hey! Im having problems dividing a view.
I want to do in Draw Event:
GML:
view_xview[0] + 16, view_yview[0] / 2
so that it draws the text always in the middle of the view vertically.
And then so that there are three lines of dialogue on top of one another, I want to reduce their y-var so they stack, like:

Code:
view_xview[0]+16, view_yview[0]/2 - 16
view_xview[0]+16, view_yview[0]/2
view_xview[0]+16, view_yview[0]/2 + 16
but that doesnt work (as i expected). How do I mark the dividing and reducing correctly?
SOLVED!
did like this:

GML:
    draw_text_outline(view_xview[0]+16, (view_yview + view_hview / 2) - 16, input1, c_white, c_black);
    draw_text_outline(view_xview[0]+16, (view_yview + view_hview / 2), input2, c_white, c_black);
    draw_text_outline(view_xview[0]+16, (view_yview + view_hview / 2) + 16, input3, c_white, c_black);
works as intended now.
 

davawen

Member
The problem is you are drawing it at half the position of the view, when you want to draw it at the position of the view + half the height of the view.
GML:
var _x = camera_get_view_x(view_camera),
    _y = camera_get_view_y(view_camera),
    _h = camera_get_view_height(view_camera);

draw_text(_x + 16,  _y + _h/2, "");
But, the most important is you don't need to, you want to put the text in the draw gui event, where the position isn't influenced by the view.

So, in the draw gui event, this would be the code.
GML:
var _h = display_get_gui_height();

draw_text(16, _h/2);
You also want to set the halign.
I'm on my phone right now so there are probably mistakes, but it should give you the general idea.
 
Top