Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Spacing bettween characters

When creating a card game the Ten (10) seems to have a lot of space between the 1 & 0.
Is there a way to squish this space between the 1-&-0 ?

Comments

  • dave1707dave1707 Mod
    edited October 2017 Posts: 8,464

    What font and font size are you using. Using the default font and font size shows the 10 OK to me.

  • edited October 2017 Posts: 122

    don't know. maybe try making an image instead of using text, i don't think you can force it to squish together. well, maybe you could make a custom font. but heres doing it as an image.


    function setup() w,h = 70,70 tx={1,0} xx={25,45} yy={35,35} textImage = image(w,h) setContext(textImage) fill(100) noStroke() noSmooth() rect(0,0,w,h) tRedColor = 255 fill(tRedColor) font('Inconsolata') fontSize(70) text(tx[1], xx[1], yy[1]) text(tx[2], xx[2], yy[2]) setContext() --this for loop makes the text transparent pixels. local function f(x) for i = 1,w do for j = 1, h do r,g,b,a = x:get(i,j) if r==tRedColor then x:set(i,j,color(0,0)) --transparent pixels end end end end f(textImage) --comment this out if you want normal text. i just wanted to show off end function draw() --noSmooth() sprite(textImage,w/2,h/2,w,h) end
  • Posts: 196

    I realize I did not set the font in set-up. I was fiddleing with the Print a random card program (to screen) that I got from the fourm. I see the number 10 had way to much space between the 1-&-0...I'LL get back to the drawing board...

Sign In or Register to comment.