Mintoris
Jun 23, 2018, 05:26 AM *
Welcome, Guest.

login

register

Did you miss your activation email?


Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: 1 [2]
  Print  
Author Topic: Displaying text  (Read 318 times)
Crazy C
Full Member
***
Posts: 16



« Reply #20 on: Jun 13, 2018, 02:28 AM »

Now there is too much space between the characters, looks really bad.
With sizes other than powers of 8 there are artefacts above the characters.
My phone HAS hardware acceleration and my Android SUPPORTS it.
I'm very disappointed and need a break from Mintoris BASIC, sorry.
Why are fonts and text such a problem in your game engine at all?
It's very important in all kinds of programs.

Logged
Mintoris
Administrator
Full Member
*****
Posts: 27



« Reply #21 on: Jun 13, 2018, 05:24 AM »

Because you can't use the standard text drawing methods in the tile graphics mode. Sorry you had such a bad experience. Usually people are quite pleased with Mintoris Basic. Text in the game engine mode as always been a problem.

I thought the new character spacing looked good.

Logged
Crazy C
Full Member
***
Posts: 16



« Reply #22 on: Jun 13, 2018, 05:31 AM »

Some more screenshots...
A picture worth a thousand words...
The first with charsize 32, the second 48, both have too big distance between T and e and A and S...
And: Powers of 8 now bad, too. The big M has a line below it using charsize 40...
« Last Edit: Jun 13, 2018, 05:41 AM by Crazy C » Logged
sraffens
Global Moderator
Sr. Member
*****
Posts: 220


« Reply #23 on: Jun 13, 2018, 07:23 AM »

I see that you have changed your code. What does your code look now?
Logged
Crazy C
Full Member
***
Posts: 16



« Reply #24 on: Jun 13, 2018, 10:50 AM »

My program still looks the same, I just used other charsizes for the GenFont.
Powers of 8 seemed to work fine, but now there were artefacts, too and I use powers of 16.
Maybe the width of some font glyphs is too big (too much pixels left or right of the char?)...
The character spacing is a little bit too big in general.
I hope soon this font problems can be fixed.
There is no antialiasing performed when GenSetSpriteScale or GenSetTextScale is performed?
If I load an image and draw it to the screen it looks fine, but is there a possibility to scale it with antialiasing when/after loading it, before making it a sprite?

Logged
Mintoris
Administrator
Full Member
*****
Posts: 27



« Reply #25 on: Jun 13, 2018, 01:41 PM »

Ok, I just released 7.5.13. The character spacing is fixed. There was also a slight alignment problem within the tile. You're going to have to let me know how it looks because I'm not seeing any artifact problems you are describing. I see them in your screenshots tho. I changed part of the character drawing routine to speed things up. Text movement looks much smoother on the emulator running Android 4.0.4. The update will be available as soon as Google approves it.
Logged
Crazy C
Full Member
***
Posts: 16



« Reply #26 on: Jun 14, 2018, 02:12 AM »

Now it looks much better, thanks, but:

The left alignment and right alignment seem to be correct, not the centering, see screenshot.
Maybe the small o should be a little bit closer to the other characters and the small e should be closer to the big T in the word 'Text'?
RFO BASIC moves some characters 'in' the space of certain others, to let it look better, I think.

Logged
Mintoris
Administrator
Full Member
*****
Posts: 27



« Reply #27 on: Jun 14, 2018, 03:34 PM »

Heh, RFO just calls a DrawText method and they're done. We are in a completely different graphics mode here.

I just released 7.5.16. This release fixes the text centering problem and I updated the apk template with these changes. I also made sure that the exported project compiles smoothly with the latest version of Android Studio.

I didn't adjust the spacing because what looks good on one font may not on another. Currently the spacing is:

charTileSize * spacingFactor * scale + 1

in pixels where spacingFactor = 0.025

Now, I hope I can get back to the Dropbox sync routine that's giving me trouble in version 8.

It was an interesting exploration of the text and font system. I really know how to measure text, determine how far under the baseline the font will go and how to adjust the goofy scaled pixel size to make the letters fit exactly within a given space. Oh, and how to set the clip rectangle so that you can't draw outside the tile even if the font lies about it's limits.
« Last Edit: Jun 14, 2018, 05:29 PM by Mintoris » Logged
Crazy C
Full Member
***
Posts: 16



« Reply #28 on: Jun 16, 2018, 10:13 AM »

Centering ok! Thanks.
I may add that I noticed that the maxwidth of the GenAddText if it's set to screen width and the text line has a greater width than the screen width the text is no more centered around the center of the screen, but always starts at pixel 0 of the screen (and for example not at -80 or so).
So the text is no more centered, but left aligned if it has a bigger width than the screen width.
My screen width is 800 in landscape and I used this width as maxwidth parameter in the GenAddText command.

Yes, it was good to fix the bugs and improve the text output and I understand that you can not compare it with normal text output routines.
At least it looks acceptable if scaling is not used now, thanks.
Logged
Mintoris
Administrator
Full Member
*****
Posts: 27



« Reply #29 on: Jun 16, 2018, 11:07 AM »

Thanks, I'm glad I did it now. I'll look into that centering problem. This text system was mainly meant for displaying scores and stats. I think I know how to mix the elements of all the graphics modes. In version 8 I am hoping you will be able to mix and match any kind of video elements. So you could have regular text windows overlayed onto the game engine video and if you want draw graphics in the standard way (line, circle etc). You will even be able to turn the camera on behind it all. So much work to do though to get there. I'm coding as fast as I can.
Logged
Mintoris
Administrator
Full Member
*****
Posts: 27



« Reply #30 on: Jun 17, 2018, 06:38 PM »

Got this email today, Don't know what I'm going to do about it yet.

Good morning Charles,

I don't know whether or not you know it but the lattest rounds of updates from 7.5.11 has (as far as I am concerned) has completely trashed the Game Engine. My interest in the Game Engine is to design and use GUIs for calculations and the display of results (it has a lot to do with the tax man here in Spain). I have tried HTML and the Graphics modes but I find the Game Engine most pleasing, that was until the fonts started changing.

At the very time the fonts started to change I was investigating upon how I could improve on the appearance of a GUI originally specified in portrait mode and then subsequently displayed in landscape , I had it already sorted out going from 800/1280 on my tablet to 720/1184 on my phone. When the text started to shrink then regrow I thought no problem, I can tweak the locations so I was basically interested in the size and locations of the font rather than the operation of the Game Engine. It wasn't until I decided to compare a GUI in operation to a screen dump of a GUI using the original fonts and Mintoris 7.5.11 that I realised something had catastrophically gone wrong in the Game Engine, at least for me.

My modulus operandi is as follows:
I include two files of my own:
Game Engine GUI Constants to remind me what the numbers mean and Game Engine GUI.bas to do all the routine work.
I rely heavily upon arrays. The arrays are specified in an initialising routine and define the size, location, text values and input limits of objects.
Where appropriate the Game Engine GUI.bas builds up Arrays of Game Engine objects. Everything is referenced by the currently selected array index.
The Game Engine GUI keeps a track of everything that's going on, carries out input range checks, moves sliders and issues warnings.
I do not provide a cursor to move around in a display window instead I write the data over the display I keep a check on the width of the text to be displayed. Should the text string be embarrassingly long the window update is frozen and a warning issued. If the display window has more than one line and the data can be wrapped then the data is automatically wrapped to fit inside the display.

This separates the housework carried out by the Game Engine GUI.bas from the real work to be carried out in the main program.

My two devices are as follows:
Samsung Galaxy Tab A, model no SM-T280, Android 5.1.1 screen size 800x1280.
Motorola  Moto G Play , Android 6.0.1, screen size 720/1280 (1184 usable).

I have tried the latest version of my code on both devices and the oldest archive I could find for the tablet, all results are simular. All worked perfectly before the recent changes.

As a taster I have included some screen dumps to show what is going on, I am not interested at this stage in the text locations, as they can be tweaked.
 
The first program I wrote as a proving exercise I called 'Game Engine Demo', it had to do something so I gave it 'de Moivre's formula'.

I do not have a screen dump for the 'before' so I will talk through in inputs.
A reset is applied upon start up.
Reset conditions:
The main display displays 'Reset, a long press on clear'.
Root is set to '2'.
Real and Imaginary are set to  '0'.
The index reflects the position of the slider which is set to '1'.
The 'Dec', 'Set Index' slider and 'Inc'. buttons are disabled.
The 'Doodles' are of little consequence although there is a little problem with the slider input, it is the same problem  as the 'Set Index'  slider.
The 'OK' button is disabled as the number '0, j0' is invalid.

Operation:
'Root' is selected and the value '2' deleted.
'Root' is set to '5', 'Real' and 'Imaginary' set to '1'.
The 'OK' button is enabled as '1, j1' is a valid number.
Faulty displays:
'Root' displays '2', it should be '5'.
'Real' and 'Imaginary' both display '0', they should display '1'.
OK button operated:
The calculations are carried out and the 1st of 5 results are displayed in the results window.
'Set index' slider is scaled 1 to 5.
The results fail to wrap where it should at the point where there is a space ' ,j'. The 'Set Index' 'Inc' and 'Dec' buttons:
Only 4 of the 5 possible values are displayed, the 'Index n =' display remains at '1', it should follow the slider and inc and dec buttons.
'Set Index' slider:
Only 4 of the 5 possible values are displayed.
'Set Index' 'Inc' to maximum and the 'Result' window momentarily selected:
The main display displays '(Index 5)^5 = 1, j1'.

Then the program starts to get unpredictable!

I have thrown in three more screen dumps, two of the 'Impuesto Para Jubilados Sin Hijos', 7.5.11 and 7.5.16 and one of a modified 'Hello world', 'MUM' and the datum have the same screen coordinates.

I know I am using the Game Engine in an unusual way but I am sure others will be having problems (just like the fonts). If you would like me to send my source code then I would be please to comply. It's a nice clean font.

Regards,
Dave
Logged
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.062 seconds with 18 queries.