summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-08-23 00:31:18 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-08-23 00:33:38 +0300
commite4f443a57a1b1ecd95282de2908824078d19dea5 (patch)
tree6697dc3700950be8de4a774d98525bf8ca43940d /src/game.cpp
parentd4df20a913c6663a4f42294e06e8c482fc947259 (diff)
downloadminetest-e4f443a57a1b1ecd95282de2908824078d19dea5.tar.gz
minetest-e4f443a57a1b1ecd95282de2908824078d19dea5.tar.bz2
minetest-e4f443a57a1b1ecd95282de2908824078d19dea5.zip
Inventory transparency; very loosely based on sapier's commits.
Also contains some commented-out code for testing out different looks in the future.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp62
1 files changed, 53 insertions, 9 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 7c77996b8..dc3ed2456 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -319,17 +319,61 @@ void draw_hotbar(video::IVideoDriver *driver, gui::IGUIFont *font,
if(g_selected_item == i)
{
- driver->draw2DRectangle(video::SColor(255,255,0,0),
- core::rect<s32>(rect.UpperLeftCorner - v2s32(1,1)*padding,
- rect.LowerRightCorner + v2s32(1,1)*padding),
- NULL);
- }
- else
- {
- video::SColor bgcolor2(128,0,0,0);
- driver->draw2DRectangle(bgcolor2, rect, NULL);
+ video::SColor c_outside(255,255,0,0);
+ //video::SColor c_outside(255,0,0,0);
+ //video::SColor c_inside(255,192,192,192);
+ s32 x1 = rect.UpperLeftCorner.X;
+ s32 y1 = rect.UpperLeftCorner.Y;
+ s32 x2 = rect.LowerRightCorner.X;
+ s32 y2 = rect.LowerRightCorner.Y;
+ // Black base borders
+ driver->draw2DRectangle(c_outside,
+ core::rect<s32>(
+ v2s32(x1 - padding, y1 - padding),
+ v2s32(x2 + padding, y1)
+ ), NULL);
+ driver->draw2DRectangle(c_outside,
+ core::rect<s32>(
+ v2s32(x1 - padding, y2),
+ v2s32(x2 + padding, y2 + padding)
+ ), NULL);
+ driver->draw2DRectangle(c_outside,
+ core::rect<s32>(
+ v2s32(x1 - padding, y1),
+ v2s32(x1, y2)
+ ), NULL);
+ driver->draw2DRectangle(c_outside,
+ core::rect<s32>(
+ v2s32(x2, y1),
+ v2s32(x2 + padding, y2)
+ ), NULL);
+ /*// Light inside borders
+ driver->draw2DRectangle(c_inside,
+ core::rect<s32>(
+ v2s32(x1 - padding/2, y1 - padding/2),
+ v2s32(x2 + padding/2, y1)
+ ), NULL);
+ driver->draw2DRectangle(c_inside,
+ core::rect<s32>(
+ v2s32(x1 - padding/2, y2),
+ v2s32(x2 + padding/2, y2 + padding/2)
+ ), NULL);
+ driver->draw2DRectangle(c_inside,
+ core::rect<s32>(
+ v2s32(x1 - padding/2, y1),
+ v2s32(x1, y2)
+ ), NULL);
+ driver->draw2DRectangle(c_inside,
+ core::rect<s32>(
+ v2s32(x2, y1),
+ v2s32(x2 + padding/2, y2)
+ ), NULL);
+ */
}
+ video::SColor bgcolor2(128,0,0,0);
+ driver->draw2DRectangle(bgcolor2, rect, NULL);
+
if(item != NULL)
{
drawInventoryItem(driver, font, item, rect, NULL);