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.

Bug Reports / Pound sign with custom font and GetInAppPurchaseLocalPrice()

Author
Message
Kevin Cross
13
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 27th Nov 2016 08:43 Edited at: 27th Nov 2016 08:43
If you use custom font images that assigns the £ sign to it's correct char code (163) it shows in the default AppGameKit font when you want do display it. This causes a problem when you use functions like GetInAppPurchaseLocalPrice() because the £ sign is included in the returned string so you end up with the £ sign being displayed in the AppGameKit font and the price showing in your custom font, these are often different sizes on the screen so looks messy and mis-aligned.

To get around it for my project I've had to do some ReplaceString calls to the returned string before displaying it. I believe it's the second ReplaceString in the example below that actually works.

price1$ = ReplaceString(GetInAppPurchaseLocalPrice(1), "£", "", -1)
price1$ = ReplaceString(price1$, chr(163), "", -1)
SetTextString(txtMenuItemRight[2, 1], price1$)

This is fine for the £ sign but there's a number of other currency signs that will probably cause problems so will require a dozen or so ReplaceStrings removing all currency signs.

In the custom font project enclosed with AppGameKit you have assigned the £ sign to char(38). This is doable for all currency signs but doing so means we're replacing other characters that we might need, i.e. I could replace the [ character with the ¥ currency symbol but if I later need the [ sign it won't be available. You'd still need ReplaceStrings though i.e.

price$1 = ReplaceString(GetInAppPurchaseLocalPrice(1), chr(163), chr(38), -1) // Changing correct £ character to position 38 in the custom font image which should be &
price$1 = ReplaceString(price1$, chr(165), chr(91), -1) // Changing the correct ¥ to position 91 in the custom font image which should be [

Can we get the full ascii code added to AppGameKit so that we don't have to do fixes like this?

This thread has an example program that only shows a limited character set is supported: https://forum.thegamecreators.com/thread/192586#msg2295990
the12thplaya

Login to post a reply

Server time is: 2017-10-20 18:53:41
Your offset time is: 2017-10-20 18:53:41