aboutsummaryrefslogtreecommitdiff
path: root/games/minimal/mods/default/textures/default_junglegrass.png
blob: 7066f7dd95418fb818b73a49ec7674afc72deac0 (plain)
ofshex dumpascii
0000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 00 10 00 00 00 18 04 03 00 00 00 01 8e 60 .PNG........IHDR...............`
0020 3f 00 00 00 0f 50 4c 54 45 00 00 00 18 30 04 24 48 07 3e 65 19 59 8e 28 35 32 2d 65 00 00 00 01 ?....PLTE....0.$H.>e.Y.(52-e....
0040 74 52 4e 53 00 40 e6 d8 66 00 00 00 8c 49 44 41 54 08 1d 05 c1 8b 95 85 30 08 40 c1 6b 42 01 6b tRNS.@..f....IDAT.......0.@.kB.k
0060 62 01 fa a0 80 7c 28 80 a3 f4 5f d3 ce 00 00 00 16 20 06 ec 80 17 90 ea 10 40 89 1d 12 1b b0 3a b....|(..._..............@.....:
0080 64 23 60 c5 3f 48 e2 08 5d 24 44 89 2e f2 25 b9 5d e5 eb 0b a1 3f be 2a 10 6a 3e 1d 4a ea ae cf d#`.?H..]$D...%.]....?.*.j>.J...
00a0 80 62 f1 57 55 12 ce 1c de d5 c9 c3 7c ad 06 bf 68 3e 9b 05 a5 3f d7 29 23 d9 6d e9 53 25 60 36 .b.WU.......|...h>...?.)#.m.S%`6
00c0 d5 2f 5f a8 e7 d4 ef 6d 48 b4 fb 72 0b 0e a3 5d d3 6e b8 7e fd 1d 72 ff 03 61 dc 15 f5 eb 76 a5 ./_....mH..r...].n.~..r..a....v.
00e0 a3 00 00 00 00 49 45 4e 44 ae 42 60 82 .....IEND.B`.
n85' href='#n85'>85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 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 280 281 282 283
// 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:

		//! constructor
		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;