none
Why does GraphicsWindow.FontSize not work in the web version of Small Basic? RRS feed

  • Question

  • Here's an example of a game I wrote but the whole thing uses resized text rather than sprites, and the FontSize doesn't seem to work in the browser.

    HLB146

    Thanks, Glenn.

    Friday, June 1, 2018 9:51 PM

Answers

  • I can't tell you why the issue happens in the siverlight version and cannot test it (seems like silverlight stopped working for me) but unfortunately there are several issues with SL versions.

    See here Font and Pen Width Change Earlier in Remote

     if a preceding 'Program.Delay' will work for you as a workaround.

     

    PS: Instead of

    'GraphicsWindow.DrawText'   and  clearing the GW  with  'GraphicsWindow.Clear'  every loop,

    perhaps consider using a Textshape  from 'Shapes.AddText'  and change its text with 'Shapes.SetText'.

    Friday, June 1, 2018 11:04 PM
    Answerer

All replies

  • I can't tell you why the issue happens in the siverlight version and cannot test it (seems like silverlight stopped working for me) but unfortunately there are several issues with SL versions.

    See here Font and Pen Width Change Earlier in Remote

     if a preceding 'Program.Delay' will work for you as a workaround.

     

    PS: Instead of

    'GraphicsWindow.DrawText'   and  clearing the GW  with  'GraphicsWindow.Clear'  every loop,

    perhaps consider using a Textshape  from 'Shapes.AddText'  and change its text with 'Shapes.SetText'.

    Friday, June 1, 2018 11:04 PM
    Answerer
  • Thanks, I will try the delay and also will look into Shapes.AddText.

    Saturday, June 2, 2018 11:06 AM
  • I've been looking to rewrite my program using Shapes.AddText and Shapes.SetText but I don't think it's going to work. It's important that the symbols are chosen randomly from an array (symbols) and also are set to a colour from another array (colours).

    If I create them with Shapes.AddText then I can't work out how to change the colour of that text later. Would anyone know a simple way of doing this? I'd rather avoid having a Shape for each colour variation.

    Thanks, Glenn.

    Tuesday, June 5, 2018 10:03 PM
  • Most simple way would be

    LDShapes.PenColour    to change the Text color for an existing TextShape, Button, outlines

                                          on geometry shapes etc     and

    LDShapes.BrushColour    for its background color

    PS:

    also look at 'LDShapes.Font'  to change FontName, -Size,  -Bold, -Italic  if needed.


    Tuesday, June 5, 2018 10:12 PM
    Answerer