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 / Rotate text around its centre rather than the default top edge - possible?

Author
Message
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 5th Dec 2019 15:24
Hi All,

Is it possible to rotate text around the centre of the text rather than its default top edge? Sprites have the SetSpriteOffset command which makes it easy... is there any equivalent for texts? I've had a look at the manual but can't spot anything. Anyone got a simple way of achieving it?

Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 5th Dec 2019 17:24
Someone posted a function for doing it which seems to work even with rotation etc...



its even easier if you dont have to account for rotation of the text.
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 5th Dec 2019 18:19
Cheers Bengisimo - get it - compensate by moving the text about as it rotates... clever.
Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 5th Dec 2019 19:58
Cool (yeah - its like you said compensate for half the height and any rotation)

It might be nice if we had an option in SetTextAlignment() to specify Middle left(4), middle centre(5), middle right(6) and lower left(7), lower right(9) etc.... We already have top left, top middle.... etc...
Or.. a set textoffset() like you said might be good.
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 12th Dec 2019 10:35 Edited at: 12th Dec 2019 10:37
@DavidAGK

AGK is missing the SetTextOffSet() and GetTextOffSetX, GetTextOffSetY() commands.
What makes placing text into a Sprite unnecessary complecated.

I reseted the Sprites-OffSet to 0, 0 and made so my calculations



I tricked the Skeleton-System with my own "Animation" to use it for a menu

I used the files: empty1px1px.png // it is a 1 by 1 Pixel PNG file, not transparent for Debug purpose.
OneBoneOnly.scon a Skeleton Animation created with Spriter with only one Bone. (because at this moment we have no "CreateSkeleton2DBone... command", but can load Skeleton2D-Animations)

Attachments

Login to view attachments
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 12th Dec 2019 16:53
More work-arounds! Love it!
Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)

Login to post a reply

Server time is: 2024-04-19 06:45:34
Your offset time is: 2024-04-19 06:45:34