How to create a window?
Moderator: Moderators
How to create a window?
How can i create a "window"? if would be alsow ok if its only a gray square.
Re: How to create a window?
Code: Select all
function widget:DrawScreen()
gl.Color(0.5, 0.5, 0.5, 1)
gl.Rect(left, bottom, right, top)
end
Re: How to create a window?
It's not like a desktop app, you don't need windows. You can write and Draw anywhere in the Screen, anywhere in the World, anywhere InMiniMap.
Re: How to create a window?
windows.
in spring they are just grey squares.
---
if you want a window that can be moved around and maybe even resized you could use one of the many UI frameworks like RedUI, chilli, LolUI, IceUI and whatever their names are.
in spring they are just grey squares.
---
if you want a window that can be moved around and maybe even resized you could use one of the many UI frameworks like RedUI, chilli, LolUI, IceUI and whatever their names are.
Re: How to create a window?
Thx, but is that right now?
Or have i to write anything for end? or to start?
function widget:GetInfo()
return {
name = "Blupp",
desc = "BluppBlupp",
author = "Karotte",
date = "2010",
license = "WTFOMG",
layer = 0,
enabled = true
}
function widget:DrawScreen()
gl.Color(0.5, 0.5, 0.5, 1)
gl.Rect(left, bottom, right, top)
end
Or have i to write anything for end? or to start?
function widget:GetInfo()
return {
name = "Blupp",
desc = "BluppBlupp",
author = "Karotte",
date = "2010",
license = "WTFOMG",
layer = 0,
enabled = true
}
function widget:DrawScreen()
gl.Color(0.5, 0.5, 0.5, 1)
gl.Rect(left, bottom, right, top)
end
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: How to create a window?
Of course you need to define these values.Karotte wrote: gl.Rect(left, bottom, right, top)
Re: How to create a window?
ok, and how can i aktivate my widget ingame? when im pressing F11 it doesn't appear. i have the plugin in Spring/LuaUI/wigets/ xxx.lua
Do i have to modify a file?
Do i have to modify a file?
Re: How to create a window?
Read infolog.txt, especially the parts where widgets are loaded and initialised. Maybe you'll see an error message there.
You forgot an end:
You forgot an end:
function widget:GetInfo()
return {
name = "Blupp",
desc = "BluppBlupp",
author = "Karotte",
date = "2010",
license = "WTFOMG",
layer = 0,
enabled = true,
}
end
function widget:DrawScreen()
gl.Color(0.5, 0.5, 0.5, 0.5)
gl.Rect(100,100,500,500)
end
Hum!Karotte wrote:wigets
Last edited by zwzsg on 30 Aug 2010, 13:55, edited 1 time in total.
Re: How to create a window?
I find it tons easier to start from a widget that is close to what I want to make.
Re: How to create a window?
No widget is similiar what i want so make. but thx