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 / [SOLVED] How to create italic text?

Author
Message
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 25th Jan 2021 05:55 Edited at: 25th Jan 2021 06:58
As the title stated, how do I set text to italic?

There is code for bold, but how do I do italic?

Search in forum show nothing...

document: https://www.appgamekit.com/documentation/Reference/Text.htm

Does not include any for italic

The author of this post has marked a post as an answer.

Go to answer

Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 25th Jan 2021 07:03
This post has been marked by the post author as the answer.
You would need to load a font that is specifically italic and then set the text to that font.
You get better results if you do the same thing with bold text too because when you call SetTextBold() it is actually faking a bold font and not using it as the font designer intended.
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 25th Jan 2021 07:10 Edited at: 25th Jan 2021 07:46
That is the thing, how do I EVEN KEY IT IN in the first place?
Such as editbox...

I tried pasting from clipboard an italic text, it DOES NOT WORK!

In fact, does editbox has any ability to key in italic, bold and even underline?

Will agk every have te4xt and editbox capable of html tags?
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 26th Jan 2021 13:22 Edited at: 26th Jan 2021 13:23
Editboxes won't let you add formatting to certain characters. So no to bold, italics, and underline in an editbox.

That's also a no to italics and underlines in AppGameKit unless as mentioned above you load a font that has those affects applied to them. You can apply a loaded font to an editbox

Some possible work arounds without loading a font would be to apply an angle to each character for iaics. SetTextCharAngle(). It's not quite the same but will tilt each character. This won't work in an edit box because you can't change the style of each character.

Underlines would be easy by positioning a thin rectangle sprite underneath the text item. You can set the width of that sprite based on GetTextTotalWidth(). I don't think sprites appear above edit boxes so you probably couldn't do this trick with an edit box and a rectangular sprite for the underline.
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 27th Jan 2021 15:13
I discovered that it is impossible to underline only certain character as underline or bold or even italic as there is no such function as 'SetTextChrFont(fontID, font_in_string_no.)' function...

So that means, visual novel games is no go for AGK...
Text editor app and games is no go for AGK...
TTS app is also a no go...

Pretty much everything that required a good editbox and text input is a no go...

But custom code to make them possible has already been... done!
So AppGameKit still works for us!
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 28th Jan 2021 18:55
Quote: "So that means, visual novel games is no go for AGK...
Text editor app and games is no go for AGK...
TTS app is also a no go..."


FALSE

Novel games/(text based) were developed as far back as 1977 when edit boxes did not even exist

There are lots of methods that exist which may be using your own bitmap font, or a true type font
of different types ie there are many that have bold/italic and underlined versions of them. you may
not be able to use different ttf in one text box but theres ways to achieve that and ofcourse you
could use dlls written by other agk users and lastly could make your own text boxes







fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk

Login to post a reply

Server time is: 2024-11-24 05:50:48
Your offset time is: 2024-11-24 05:50:48