Open main menu

Difference between revisions of "AGIWiki/Display text on screen"

m
Text replacement - "<source lang=" to "<syntaxhighlight lang="
(Fix syntax highlighting)
m (Text replacement - "<source lang=" to "<syntaxhighlight lang=")
Line 17: Line 17:
A typical messagebox, displayed in the middle of the screen.
A typical messagebox, displayed in the middle of the screen.


<source lang="cpp">
<syntaxhighlight lang="cpp">
print("Hello world");
print("Hello world");
</source>
</source>
Line 23: Line 23:
Same but using ability to use #message .
Same but using ability to use #message .


<source lang="cpp">
<syntaxhighlight lang="cpp">
print(m1);
print(m1);


Line 32: Line 32:
This time in the #message-part has been put a [[AGIWiki/String|string]]. Note that string s1 has been defined '''before''' using print-command and #message can be also elsewhere within the logic than beneath return-command.
This time in the #message-part has been put a [[AGIWiki/String|string]]. Note that string s1 has been defined '''before''' using print-command and #message can be also elsewhere within the logic than beneath return-command.


<source lang="cpp">
<syntaxhighlight lang="cpp">
set.string(s1,"Hello world");
set.string(s1,"Hello world");
print(m1);
print(m1);
Line 44: Line 44:
Print.v provides a way for one print.v to display various messages. Once again it is important to define all modifiers before printing.
Print.v provides a way for one print.v to display various messages. Once again it is important to define all modifiers before printing.


<source lang="cpp">
<syntaxhighlight lang="cpp">
v40 = 2; /* Oh hai just sounds better than Hello */
v40 = 2; /* Oh hai just sounds better than Hello */
set.string(s1,"Hello world");
set.string(s1,"Hello world");
Line 58: Line 58:
Should a need for displaying messagebox elsewhere than middle arise, print.at is the solution.
Should a need for displaying messagebox elsewhere than middle arise, print.at is the solution.


<source lang="cpp">
<syntaxhighlight lang="cpp">
print.at(m2,1,20,10);
print.at(m2,1,20,10);
   
   
Line 73: Line 73:
With this command WinAGI is the IDE. The correct syntax being <code>print.at.v(vA,byte ROW,byte COLUMN,byte MAXWIDTH);</code>
With this command WinAGI is the IDE. The correct syntax being <code>print.at.v(vA,byte ROW,byte COLUMN,byte MAXWIDTH);</code>


<source lang="cpp">
<syntaxhighlight lang="cpp">
#message 2 "Hallo world"
#message 2 "Hallo world"
#message 1 "%s1"
#message 1 "%s1"
Line 95: Line 95:
AGI Studio's helpfile claims that command should be like this: <code>print.at.v(vA,vX,vY,vW);</code> but it only accepts <code>print.at.v(mA,vX,vY,vW);</code>. It is better to avoid using this command under AGI Studio altogether and compile it with WinAGI and with correct syntax.
AGI Studio's helpfile claims that command should be like this: <code>print.at.v(vA,vX,vY,vW);</code> but it only accepts <code>print.at.v(mA,vX,vY,vW);</code>. It is better to avoid using this command under AGI Studio altogether and compile it with WinAGI and with correct syntax.


<source lang="cpp">
<syntaxhighlight lang="cpp">
#message 2 "Hello world"
#message 2 "Hello world"
   
   
TrustedUser
2,147

edits