aboutsummaryrefslogtreecommitdiff
path: root/games/minimal/mods/default/textures/default_jungletree_top.png
diff options
context:
space:
mode:
authorSfan5 <sfan5@live.de>2013-09-09 22:46:18 +0200
committerSfan5 <sfan5@live.de>2013-09-09 22:50:51 +0200
commit3725179736e2b5372664163470e7ef3dc76529a4 (patch)
tree7a56c929ae75530679b3d2f7c9c02fb361760219 /games/minimal/mods/default/textures/default_jungletree_top.png
parent1f3402e7a1e160c4be25c596f33d916b988075fb (diff)
downloadminetest-3725179736e2b5372664163470e7ef3dc76529a4.tar.gz
minetest-3725179736e2b5372664163470e7ef3dc76529a4.tar.bz2
minetest-3725179736e2b5372664163470e7ef3dc76529a4.zip
Use system-wide LevelDB instead of bundled one
Diffstat (limited to 'games/minimal/mods/default/textures/default_jungletree_top.png')
0 files changed, 0 insertions, 0 deletions
a> 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// Copyright (C) 2016 Nathanaƫl Courant
//   Modified this class to work with EnrichedStrings too
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

#pragma once

#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_GUI_

#include "IGUIStaticText.h"
#include "irrArray.h"

#include "log.h"

#include <vector>

#include "util/enriched_string.h"
#include "config.h"
#include <IGUIEnvironment.h>

#if USE_FREETYPE

namespace irr
{

namespace gui
{

	const EGUI_ELEMENT_TYPE EGUIET_ENRICHED_STATIC_TEXT = (EGUI_ELEMENT_TYPE)(0x1000);

	class StaticText : public IGUIStaticText
	{
	public:

		// StaticText is translated by EnrichedString.
		// No need to use translate_string()
		StaticText(const EnrichedString &text, bool border, IGUIEnvironment* environment,
			IGUIElement* parent, s32 id, const core::rect<s32>& rectangle,
			bool background = false);

		//! destructor
		virtual ~StaticText();

		static irr::gui::IGUIStaticText *add(
			irr::gui::IGUIEnvironment *guienv,
			const EnrichedString &text,
			const core::rect< s32 > &rectangle,
			bool border = false,
			bool wordWrap = true,
			irr::gui::IGUIElement *parent = NULL,
			s32 id = -1,
			bool fillBackground = false)
		{
			if (parent == NULL) {
				// parent is NULL, so we must find one, or we need not to drop
				// result, but then there will be a memory leak.
				//
				// What Irrlicht does is to use guienv as a parent, but the problem
				// is that guienv is here only an IGUIEnvironment, while it is a
				// CGUIEnvironment in Irrlicht, which inherits from both IGUIElement
				// and IGUIEnvironment.
				//
				// A solution would be to dynamic_cast guienv to a
				// IGUIElement*, but Irrlicht is shipped without rtti support
				// in some distributions, causing the dymanic_cast to segfault.
				//
				// Thus, to find the parent, we create a dummy StaticText and ask
				// for its parent, and then remove it.
				irr::gui::IGUIStaticText *dummy_text =
					guienv->addStaticText(L"", rectangle, border, wordWrap,
						parent, id, fillBackground);
				parent = dummy_text->getParent();
				dummy_text->remove();
			}
			irr::gui::IGUIStaticText *result = new irr::gui::StaticText(
				text, border, guienv, parent,
				id, rectangle, fillBackground);

			result->setWordWrap(wordWrap);
			result->drop();
			return result;
		}

		static irr::gui::IGUIStaticText *add(
			irr::gui::IGUIEnvironment *guienv,
			const wchar_t *text,
			const core::rect< s32 > &rectangle,
			bool border = false,
			bool wordWrap = true,
			irr::gui::IGUIElement *parent = NULL,
			s32 id = -1,
			bool fillBackground = false)
		{
			return add(guienv, EnrichedString(text), rectangle, border, wordWrap, parent,
				id, fillBackground);
		}

		//! draws the element and its children
		virtual void draw();

		//! Sets another skin independent font.
		virtual void setOverrideFont(IGUIFont* font=0);

		//! Gets the override font (if any)
		virtual IGUIFont* getOverrideFont() const;

		//! Get the font which is used right now for drawing
		virtual IGUIFont* getActiveFont() const;

		//! Sets another color for the text.
		virtual void setOverrideColor(video::SColor color);

		//! Sets another color for the background.