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 / [ AGK] [Print] [Feature Request] : The possibility to set where to display the text from the Print Commands

Author
Message
Alex Goaga
9
Years of Service
User Offline
Joined: 6th Nov 2015
Location:
Posted: 26th Sep 2016 08:10
Hey guys,

I don't know how many of you are using the print option in order to display some background calculations, but I use them quite almost obscenely much.

I would want an option or a command to set the displayed text from the print feature in any corner of the scrreen

Example , ( I dont know if it's ok , for example , in steam -in-game option the fps counter can pe possitioned : on one of the following 4 positions : top-left ; top-right ; bottom left ; bottom right )

If I may add a sub-request feature , also for the print position idea:

Can be something like SetSpritePosition ( iSpriteIndex, fX, fY ) ?
for example
-> the FPS counter to be on the top-left side of the screen
-> the player sprite position to be displayed bottom right
And the examples can go on.

Thank you for your time !
Alex


BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 26th Sep 2016 08:23
Is there any reason why you can't use Text to do this?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Alex Goaga
9
Years of Service
User Offline
Joined: 6th Nov 2015
Location:
Posted: 26th Sep 2016 08:28
I was thinking about that , but it would be more time consuming and would require more code to write resulting in more things to be processed by the app.

Something like Print( szString,position )

Print( "text", 1 )

// 1- top left
// 2 - top right etc

And if is not set by the dev to any position Print( szString) // to be default position 1 like now
pinete
13
Years of Service
User Offline
Joined: 28th Jul 2011
Location:
Posted: 26th Sep 2016 10:07
Hi, I agree with Alex.
Print seems more direct than text for screen debug pursposes i.e.
With text you need to setup the text and update it, finally you need to delete it..
Not so many things in a line of a post but well, a bit more bothering than a kind of upgraded print command
From my perpspective the best use would be something like print (x,y,text)... just to propose other way.
Thanks a lot!
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 26th Sep 2016 11:24
You can make your own print function that uses Text to achieve what you want. I often use print for debugging, and the addional functionality would be useful.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
pinete
13
Years of Service
User Offline
Joined: 28th Jul 2011
Location:
Posted: 26th Sep 2016 11:31
yes, It's true!
I didn't realize it! sorry
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 26th Sep 2016 12:16
i think a command to set/get the print cursor
is useful for all.
as workaround i would use draw sprite at own text print function with a bitmap font image.
AGK (Steam) V2.0.20 : Windows 10 Pro 64 Bit : AMD (16.3.2) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 26th Sep 2016 12:34
Can you capture text in an image? I would normally print the text to above an image and the capture the image with the text printed on it, it seems I can't do the same with the text commands.
13/0
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 2nd Nov 2016 14:49
I will just bump this thread

I have a large sprite I use for graphic output, I draw a lot of grapics on that sprite, there is an "internal" graphics system for that sprite, that makes it possible to just scale the sprite for zooming in and out, and also in a game that is not "real time", I do not have to do have much code running when nothing happens on screen saving battery, just leaving the sprite on screen. BUT, the only thing is not compatible with this battery saving logic is text commands, when I do not scale my render sprite text is fine, but when I start scaling the sprite the text objects coordinates no longer match where they should be in the sprite image :-( I would really like to able to draw text objects to an image just like I can draw a sprite to an image with the DrawSprite command.
13/0
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 2nd Nov 2016 15:01 Edited at: 2nd Nov 2016 15:36
maybe u can use the memblock commands to copy text into an image.
integer CreateMemblockFromImage( imageID )
.. copy bytes from other memblock which contains a bitmap font data into your target memblock.
CreateImageFromMemblock( imageID, memID )
DeleteMemblock( memID )
AGK (Steam) V2.0.21 : Windows 10 Pro 64 Bit : AMD (16.6) Radeon R7 265 : Mac mini OS Sierra (10.12)
damothegreat
User Banned
Posted: 2nd Nov 2016 17:10 Edited at: 2nd Nov 2016 17:12
Or you could do something like this



Damo
Using Tier 1 AppGameKit V2
Started coding with AMOS
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 2nd Nov 2016 21:50
Would that not make it "print" a lot of blank spaces? I need text to be anywhere on the screen, so if it is in the lower right corner, there would an awful lot of overhead printing all the blank spaces :-P

Anyway, I found an other way to do it. I will have each number from 0 to 9 as a small image, then I will just create a small image with the number I need, then attach that image to a sprite and then draw that sprite to screen.
13/0
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd Nov 2016 08:39
Is there any reason why you don't create the number sprite from text and then GetImage()? It would be much easier to manage.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 3rd Nov 2016 14:04
Can I capture a text object in an image? I think I tried to capture a text object in an image, but the text did not appear in my image, as far as I recall.
13/0
damothegreat
User Banned
Posted: 3rd Nov 2016 14:28
Try



Damo
Using Tier 1 AppGameKit V2
Started coding with AMOS
damothegreat
User Banned
Posted: 3rd Nov 2016 14:50
Then maybe do something fancy - like



Damo
Using Tier 1 AppGameKit V2
Started coding with AMOS
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 4th Nov 2016 15:27
Thank you for your code damo I might be able to use that

Markus, I ended up with the memblock solution
13/0

Login to post a reply

Server time is: 2024-11-25 01:40:33
Your offset time is: 2024-11-25 01:40:33