Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / How can I print three things on the same line?

Author
Message
Mark Garrett
Reviewed AGK on Steam
18
Years of Service
User Offline
Joined: 10th Jul 2005
Location: California, US
Posted: 23rd Jul 2017 17:19 Edited at: 23rd Jul 2017 17:41
These print statements print from top to bottom. But how can I get them to print on the same line (across) ?


.

Attachments

Login to view attachments
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 23rd Jul 2017 17:29
Print("some text"+Str(123)+Str(9.473))
Mark Garrett
Reviewed AGK on Steam
18
Years of Service
User Offline
Joined: 10th Jul 2005
Location: California, US
Posted: 23rd Jul 2017 17:39
How about how to this?

.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 23rd Jul 2017 17:47
just concatenate with "+" and convert numbers to string with Str()

Print ("word ="+Upper(word$))
print("GetPointerX() ="+Str(GetPointerX()))

ETC ETC

or use a string variable

printstring as string

printstring = "word ="+Upper(word$)
printstring =printstring +"pass ="pass
printstring =printstring + "GetPointerX() ="+Str(GetPointerX())
printstring =printstring + "GetPointerY() ="+Str(GetPointerY())

Print(printstring)
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 23rd Jul 2017 17:55
or use printc
life\'s one big game
spec= 2.6ghz, 1gb ram, 512mb gpu, directx 9.0c, dbpro and classic
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 29th Jul 2017 09:19 Edited at: 29th Jul 2017 09:21
Quote: "These print statements print from top to bottom. But how can I get them to print on the same line (across) ?"

Cant set the location of the text pointer Thats why we have the text commands

This may help just some commands how you use them is up to you
fubar
easter bunny
11
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 1st Aug 2017 02:28
Print should almost never be used in a game. It's pretty much just there for debugging purposes (to print info out to the screen quickly and easily).

Both concatenating strings and using printc() will work fine for what you want.
If you want to display text to the end user however, you should use the text commands

My Games - Latest WIP - My Website: Immortal.Digital - FB - Twitter
130,000 installs with AppGameKit and counting
Jerry McGuire
7
Years of Service
User Offline
Joined: 25th Mar 2017
Location:
Posted: 1st Aug 2017 17:33
The answer depends on whether you're using Tier 1 or Tier 2. In Tier 1 (BASIC) you just use "printc" and in Tier 2 you can concatenate (C++ allows you to do so with "+" ).
iMac Book Pro, MacOS 10.12.4, Xcode 8.3.3;
iPhone 6, iOS 9.35; iPhone 5s, iOS 9.35; iPad (3rd gen), iOS 9.35;

Dell Precision T7400, Windows 7 Professional 64bit, Visual Studio Community 2015;
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 2nd Aug 2017 09:19
Quote: " (C++ allows you to do so with "+" )."

So does AGK.
Signature removed by mod because it's larger than 600x120... please resize and try again.

Login to post a reply

Server time is: 2024-04-19 22:08:47
Your offset time is: 2024-04-19 22:08:47