Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

iesika

Members
  • Content Count

    1
  • Joined

  • Last visited

Posts posted by iesika

  1. I want to change font size in opencomputers screen, but It seems that API does not exist.

    So, I made this.

    • You can use range of characters from 0x0020 to 0x007E.
    • You can change font size (2-8). I recommend that you use size 4 or 8.

    Download:

    attachment file or github

    API:

    bigfont.load(size: number) -- load font file

    bigfont.set(x: number, y: number, string: number, size: number) -- writes a string to the screen

    Example:

    local bigfont = require("bigfont")
    local component = require("component")
    local gpu = component.gpu
    local w, h = gpu.getResolution()
    local args = {...}
    
    gpu.fill(1,1,w,h," ")
    
    for size = 2, 8 do
        bigfont.load(size)
    end
    
    local y = 1
    
    for size = 2, 8 do
        bigfont.set(1, y, args[1] or "size"..tostring(size), size)
        y = y + size
    end

     

    2016-09-16_00.29.38.png?raw=true2016-09-15_23.13.33.png?raw=true

     

    (sorry for my English)

     

    bigfont.zip

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.