Miniwindow Layout

Posted by Gesslar on Thu 16 Feb 2012 05:15 PM — 4 posts, 21,126 views.

#0
Grrr, this is driving me banonkers, but maybe someone might know the answer.

I want to have this kind of layout, where all 3 are at the bottom of the screen. They would be two plugins. one has the top 3 bars and the other has the bottom bar.

Top three = HP_bar, SP_bar, EP_bar
Bottom = XP_bar


========== ========== ========== 
================================


What's happening right now is that when I create the top three bars, then create the bottom bar, SP_bar disappears.

I think it has to do with something to do with the fact that they are using the same position. But I thought that they would stack, instead of overwrite.

Any suggestions?
USA #1
You're exactly right on what the problem is: miniwindows don't stack, they overlap. You'll need to manually position the upper gauges to offset them from the bottom.

It sure would be cool if you could use CSS to build your layout:
row {
  width: 100%;
  position: fixed;
}

row#xp-gauges {
  bottom: 0px;
  height: 20px;
}

row#other-gauges {
  bottom: 20px;
  height: 20px;
}

It could probably be done in MUSHclient, though it'd take a while...
Amended on Thu 16 Feb 2012 07:55 PM by Twisol
Australia Forum Administrator #2
You can manually position them. For example the upper one could find out where the other two are and put itself on top of them.
USA #3
This is how I handle my single prompt bar. Granted it's not two lines but I think you'll get the picture.

			--health bar
			bar_offset = 5
			health_left_offset = bar_offset
			mana_left_offset = bar_offset*3+151
			top_offset = 6
			bar_width = 150
			bar_height = 20
			
			WindowRectOp("promptw", 2, health_left_offset, top_offset, bar_width+1, bar_height+1, ColourNameToRGB("silver"), ColourNameToRGB("silver"))
			
			if health > 0 then
			WindowRectOp("promptw", 2, health_left_offset + 1, top_offset + 1, bar_width*(health/max_health), bar_height, ColourNameToRGB(health_font_colour), ColourNameToRGB("silver"))
			end
			
			-- Mana bar
			WindowRectOp("promptw", 2, mana_left_offset, top_offset, mana_left_offset+bar_width+1, bar_height+1, ColourNameToRGB("silver"), ColourNameToRGB("silver"))
			if mana > 0 then
			WindowRectOp("promptw", 2, mana_left_offset + 1, top_offset + 1, mana_left_offset+(bar_width*(mana/max_mana)), bar_height, ColourNameToRGB(mana_font_colour), ColourNameToRGB("silver"))		
			end
			
			--WindowText("promptw", "pwf", health .. ", ", left_offset, top_offset, 0, 0, ColourNameToRGB(health_font_colour), 0) -- health
			--left_offset = left_offset + string.len(health .. ", ")*font_width_offset
			--WindowText("promptw", "pwf", mana .. ", ", left_offset, top_offset, 0, 0, ColourNameToRGB(mana_font_colour), 0) -- mana
			left_offset = mana_left_offset + bar_width + 1 + bar_offset
			WindowText("promptw", "pwf", endurance .. ", ", left_offset, top_offset, 0, 0, ColourNameToRGB(endurance_font_colour), 0) -- endurance
			left_offset = left_offset + string.len(endurance .. ", ")*font_width_offset
			WindowText("promptw", "pwf", willpower .. " ", left_offset, top_offset, 0, 0, ColourNameToRGB(willpower_font_colour), 0) -- willpower
			left_offset = left_offset + string.len(willpower .. " ")*font_width_offset