GOOi, an Android-Oriented GUI Library

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: GÖÖi, an Android-Oriented GUI Library

Post by alberto_lara »

You're actually right, the second one is the normal way, not sure what I was thinking, let me check that out :)
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: GÖÖi, an Android-Oriented GUI Library

Post by alberto_lara »

Done! now the canvas logic is as usual:

Code: Select all

function love.draw()
	-- Do canvas stuff:
	gr.setCanvas(canvas)
	gr.clear()

	gr.setColor(62, 131, 95)
	gr.rectangle("fill", 0, 0, width, height)

	gr.setColor(255, 255, 255)
	gr.draw(imgBg, 0, 0)
	gooi.draw()

	gr.setCanvas()
	gr.draw(canvas, 0, 0, 0, scale, scale)--   <--Scale your canvas
end
EDIT: I didn't even notice the colors where wrong, this is GÖÖi scaled (x4), with and without nearest filter:
Image

EDIT 2: Multitouch is not working on scaled canvases, in Android... I'm checking this.

EDIT 3: Done, now it sems to work fine in Desktop and Android, scaled or not :) try this .love, comment the lines according to the platform:
demoCanvas.love
(131.58 KiB) Downloaded 149 times
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: GÖÖi, an Android-Oriented GUI Library

Post by alberto_lara »

Version 0.0.1 is now officially released, there are vertical sliders now:
Image

P.S. Süsse has not this version yet
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: GÖÖi, an Android-Oriented GUI Library

Post by alberto_lara »

I've created a Wiki for GÖÖi (is still missing some details but it's good enough for now), hope you like it!
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Re: GÖÖi, an Android-Oriented GUI Library

Post by ArchAngel075 »

encountered an issue,
take the below code

Code: Select all

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

Code: Select all

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

Code: Select all

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

**EDIT**
fix found :
changing gooi/gooi.lua line: 1815
from

Code: Select all

love.graphics.setFont(gooi.getFont())-- Specific or a common font.
to

Code: Select all

love.graphics.setFont(gooi.getFont(comp))-- Specific or a common font.
Issue tracked @ https://github.com/tavuntu/gooi/issues/6
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: GÖÖi, an Android-Oriented GUI Library

Post by alberto_lara »

It's fixed now, thanks!
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: GÖÖi, an Android-Oriented GUI Library

Post by alberto_lara »

Here's the canvas demo (updated):
demo_canvas.love
(131.22 KiB) Downloaded 116 times
Last edited by alberto_lara on Wed Jan 11, 2017 10:24 pm, edited 1 time in total.
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: GÖÖi, an Android-Oriented GUI Library

Post by alberto_lara »

xopxe wrote:Is it possible / will it be possible to have vertical sliders?
it's possible now
trelemar
Prole
Posts: 22
Joined: Fri Dec 16, 2016 12:21 pm

Re: GÖÖi, an Android-Oriented GUI Library

Post by trelemar »

Could you ever implement something like this?

Panel:getComponent(row, column)
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: GÖÖi, an Android-Oriented GUI Library

Post by alberto_lara »

Sure, why not, feel free to open a request issue
Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests