安装 Steam
登录
|
语言
繁體中文(繁体中文)
日本語(日语)
한국어(韩语)
ไทย(泰语)
български(保加利亚语)
Čeština(捷克语)
Dansk(丹麦语)
Deutsch(德语)
English(英语)
Español-España(西班牙语 - 西班牙)
Español - Latinoamérica(西班牙语 - 拉丁美洲)
Ελληνικά(希腊语)
Français(法语)
Italiano(意大利语)
Bahasa Indonesia(印度尼西亚语)
Magyar(匈牙利语)
Nederlands(荷兰语)
Norsk(挪威语)
Polski(波兰语)
Português(葡萄牙语 - 葡萄牙)
Português-Brasil(葡萄牙语 - 巴西)
Română(罗马尼亚语)
Русский(俄语)
Suomi(芬兰语)
Svenska(瑞典语)
Türkçe(土耳其语)
Tiếng Việt(越南语)
Українська(乌克兰语)
报告翻译问题
this is the most basic form of what you are looking for.
textToDraw - is the list that will hold all the text
startX - the horizontal location to start drawing text
startY - the vertical location to start drawing text
Here is a more extensive dialog box system by Shaun Spalding (big youtuber who makes GMS videos)
EDIT: the example starts drawing the text at the bottom of the screen. Each new line will be drawn above the last one by the use of startY-string_height("X")*i
It will not stop though. If you have 100 lines it will draw all 100 lines of text. To limit this function you will have to clamp the number of lines in the for loop
1. when I add an event to add addittional text, in this case I simply added a spacebar event that created a new line that said test", it creates the new line above the previous text, how would I tell it to draw the text below and shift the previous text upwards?
2. I try to make the text box appear a little bit higher so I can fit buttons underneath the text but changing the startY=room_height-32 to a lower number such as -20, but I don't see it really adjusting it. I changed the "-" to a "=" and it shifted the text to the top of the screen entirely, but that wasn't quite what I was looking for. Could this be due to my room height in general?
Thank you again.
to reverse the order of the lines, think about what you're drawing, and where you are drawing it. Let's say you want to draw the 10 most current lines in a 'warcraft' texty style.
text0 <-- first line of text entered into the list
text1
text2
text3
text4
text5
text6
text7
text8
text9 <-- most current line of text
in a 'for' loop we can count up (1,2,3,4,5,etc..) or we can count down (5,4,3,2,1, etc..) In this case counting from the most current text to the oldest text seems the way to go as we wont have to adapt our already given code too much to assimilate it. So let's see what the new code looks like
The room origin starts in the top left corner (0,0) when we draw text or any other thing for that matter we can draw it absolutely on the screen. Or we can draw it relative to something in the room.
Remember on the horizontal plane we subtract to go left and we add to go right. On the vertical plane we subtract to go up and we add to go down.
So to move the current location of the text box up we need to change the startY by subtracting even more from room height
you know you have a list that starts at index 0 and ends at size-1;
there are gamemaker math functions that can clamp values for you such as
max(value1,value2) -> will return the maximum value
min(value1,value2) -> will return the minimum value
median(value1,value2,value3) -> will return the middle value of all values
examples