Yes.strangely wrote:I'm playing around with this now and I'm wondering how @JohnWordsworth figured out that context had color, drawRect and button functions.
Does anyone have a list of the available functions?
Yes.strangely wrote:I'm playing around with this now and I'm wondering how @JohnWordsworth figured out that context had color, drawRect and button functions.
Does anyone have a list of the available functions?
Code: Select all
local x,y,width = 200,600,300
local text = "Implements the Goromorg shield effect for monsters. The shielded monster is invulnerable to all damage. Instead the damage is directed to the shield. When the shield’s energy is depleted the shield is destroyed."
local tw,th = g.drawParagraph(text,x,y,width)
local text2 = "Makes the object breakable. Typically used with Obstacle component to make breakable obstacles. When the health value reaches zero, the object is destroyed."
local tw,th = g.drawParagraph(text2,x,y+th,width)
Code: Select all
local x,y,width = 200,600,300
local text = "Implements the Goromorg shield effect for monsters. The shielded monster is invulnerable to all damage. Instead the damage is directed to the shield. When the shields energy is depleted the shield is destroyed."
local tw,th = g.drawParagraph(text,x,y+15,width)
-- now we have the height so we can draw the rectangle
g.drawRect(x,y,width,th)
-- and print the text again on top of that
-- if your rectangle is transparent you can adjust the x and y of the secondly drawn text and get a nice shadow effect for the text.
local tw,th = g.drawParagraph(text,x,y+15,width)
JohnW is apparently already doing some kind of GUI-library/framework and I'm sure it's going to be great, so I will use my time in something else. And I think that Grimwidgets was maybe too complicated for regular modders, I would like to see something a bit simpler.Drakkan wrote:Thank JKos, sounds fantastic. I have noticed you were quite active in Log1 gui framework, together with thomson and Xanathar. Are you planning some converting of grimwidget or something like that ? I would especially welcome this system for hiring / releasing party members which were done in Log1.
make sense. looking forward to the future thenJKos wrote:JohnW is apparently already doing some kind of GUI-library/framework and I'm sure it's going to be great, so I will use my time in something else. And I think that Grimwidgets was maybe too complicated for regular modders, I would like to see something a bit simpler.Drakkan wrote:Thank JKos, sounds fantastic. I have noticed you were quite active in Log1 gui framework, together with thomson and Xanathar. Are you planning some converting of grimwidget or something like that ? I would especially welcome this system for hiring / releasing party members which were done in Log1.
However I'm currently working on a general use Dialogue system and it's progressing pretty nicely, it was surprisingly easy to implement with the new GUI features. I'm probably going to release it soon.
Code: Select all
-- NOT REAL GUI CODE - WILL NOT WORK IN LOG2 (YET)
imgui.beginPanel({x=100, y=100, width=200, height=100, bgColor={255, 255, 255, 128}})
imgui.label(…)
imgui.button(...)
imgui.slider(…)
imgui.endPanel()
Code: Select all
-- NOT REAL GUI CODE - WILL NOT WORK IN LOG2 (YET)
defineWindow{
name = “windowA”,
widgets = {
{ type=“panel”, x=100, y=100, width=200, height=100, bgColor={255, 255, 255, 128},
children={
{ type=“label”, … },
{ type=“button”, onClick=function(button) end, … }
}
}
}
}
local window = grimtk:createWindow("windowA");
-- later
window:destroy();