Mini window

Post Reply
Manni
Posts: 116
Joined: Tue May 31, 2011 9:00 pm

Mini window

Post by Manni »

I'm trying to create a miniconsole that I can actively echo into so I can track what afflictions my opponent has. I can't get this window to initiate on startup though, and I haven't figured out the issue. Any help would be greatly appreciated.



window function:
Code: [show] | [select all] lua
ct_track_font = ct_track_font or 10 -- edit this to change the size.

function ct_window()
	WindowWidth, WindowHeight = getMainWindowSize()
	createMiniConsole("ct_track",0,0,0,0)
	setBackgroundColor("ct_track",0,0,0,0)
	setMiniConsoleFontSize("ct_track", ct_track_font)
	local x, y = calcFontSize( ct_track_font )
	resizeWindow( "ct_track", x*30, y*24 )
	moveWindow( "ct_track", WindowWidth-x*60-20, 0) -- -20 to keep the scroll bar visible
end

User avatar
Omit
Posts: 190
Joined: Sun Aug 01, 2010 10:54 pm
Location: Middle Earth
Contact:

Re: Mini window

Post by Omit »

problem is here....
createMiniConsole("ct_track",0,0,0,0)

0 font size
0 chars wide
0 char high

try to create it larger for starters (check it out in the manual)

Manni
Posts: 116
Joined: Tue May 31, 2011 9:00 pm

Re: Mini window

Post by Manni »

changed it, same issue. Thanks for helping

change:
Code: [show] | [select all] lua
ct_track_font = ct_track_font or 10 -- edit this to change the size.

function ct_window()
	local x, y = calcFontSize( ct_track_font )
	WindowWidth, WindowHeight = getMainWindowSize()
	createMiniConsole("ct_track",WindowWidth-x*60-20,0,x*30,y*24)
	setBackgroundColor("ct_track",0,0,0,0)
	setMiniConsoleFontSize("ct_track", ct_track_font)
end

User avatar
Omit
Posts: 190
Joined: Sun Aug 01, 2010 10:54 pm
Location: Middle Earth
Contact:

Re: Mini window

Post by Omit »

hmm... hate to even mention this.... are you calling your function somewhere?

add
ct_window()
after the function (code looks ok to me and I have been working on my own miniconsoles all night.)

Manni
Posts: 116
Joined: Tue May 31, 2011 9:00 pm

Re: Mini window

Post by Manni »

you sir... have just pointed out my idiocity... thank you

Post Reply