Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

component specific font not applied [fix included] #6

Closed
ArchAngel075 opened this issue Jan 11, 2017 · 1 comment
Closed

component specific font not applied [fix included] #6

ArchAngel075 opened this issue Jan 11, 2017 · 1 comment

Comments

@ArchAngel075
Copy link

encountered an issue,
take the below code

local defaultStyling = {
    bgColor = {12, 183, 242, 170}, -- LOVE blue
    fgColor = {255, 255, 255, 255}, -- Foreground color
    tooltipFont = love.graphics.newFont(10), -- tooltips are smaller than the main font
    radius = 3, -- radius for the outer shapes of components
    innerRadius = 3, -- For the inner ones
    showBorder = false, -- border for components
    borderColor = {12, 183, 242, 255},
    borderWidth = 2, -- in pixels
    font = love.graphics.newFont(48),
    mode3d = false, -- gives that subtle gradient on the given color
    glass = false -- for a glass effect (horizon reflection)
}
  local lab = gooi.newLabel({
    text = "hello my name is bob",
    x = 25,
    y = 150,
    w = 100,
    h = 30,
    align = "left", -- text alignment
    icon = "imgs/exit.png",
})
  lab:setStyle(defaultStyling)

copied directly from the wiki. I changed the style to be font size 48.
When using

gooi.setStyle(defaultStyling)
it is applied to the label, but using

lab:setStyle(defaultStyling)
it is not applied to label.

EDIT
fix found :
changing gooi/gooi.lua line: 1815
from
love.graphics.setFont(gooi.getFont())-- Specific or a common font.
to
love.graphics.setFont(gooi.getFont(comp))-- Specific or a common font.

@gustavostuff
Copy link
Owner

Fixed, good catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants