Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
   Copyright (c) 2017 DIVIDE-Studio
   Copyright (c) 2009 Ionut Cava

   This file is part of DIVIDE Framework.

   Permission is hereby granted, free of charge, to any person obtaining a copy
   of this software
   and associated documentation files (the "Software"), to deal in the Software
   without restriction,
   including without limitation the rights to use, copy, modify, merge, publish,
   distribute, sublicense,
   and/or sell copies of the Software, and to permit persons to whom the
   Software is furnished to do so,
   subject to the following conditions:

   The above copyright notice and this permission notice shall be included in
   all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED,
   INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
   PARTICULAR PURPOSE AND NONINFRINGEMENT.
   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
   DAMAGES OR OTHER LIABILITY,
   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
   IN CONNECTION WITH THE SOFTWARE
   OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 */

#ifndef _UTILITY_TEXT_LABEL_H_
#define _UTILITY_TEXT_LABEL_H_

#include "Core/Math/Headers/MathMatrices.h"
#include "Core/Headers/StringHelper.h"

namespace Divide {
class TextLabel {
   public:
    TextLabel(const stringImpl& string,
              const stringImpl& font,
              const vec3<U8>& colour,
              U32 fontSize)
        : _width(1),
          _font(font),
          _fontSize(fontSize),
          _colour(colour),
          _blurAmount(0.0f),
          _spacing(0.0f),
          _alignFlag(0),
          _bold(false),
          _italic(false)
          
    {
        text(string);
    }

    inline void text(const stringImpl& text) {
        Util::Split(text, '\n', _text);
    }

    inline const vectorImpl<stringImpl>& text() const {
        return _text;
    }

    stringImpl _font;
    U32 _fontSize;
    U32 _width;
    F32 _blurAmount;
    F32 _spacing;
    U32 _alignFlag;  ///< Check font-stash alignment for details
    vec4<U8> _colour;
    bool _bold;
    bool _italic;

private:
    vectorImpl<stringImpl> _text;
};

};  // namespace Divide

#endif //_UTILITY_TEXT_LABEL_H_

Commits for Divide-Framework/trunk/Source Code/Utility/Headers/TextLabel.h

Diff revisions: vs.
Revision Author Commited Message
836 Diff Diff IonutCava picture IonutCava Fri 27 Jan, 2017 14:59:56 +0000

[IonutCava]
- Update copyright notice

830 Diff Diff IonutCava picture IonutCava Wed 25 Jan, 2017 17:29:44 +0000

[IonutCava]
- Add a new Platform element: File
— Move all predefined paths to FileManagement System
- Split MathHelper into MathHelper and StringHelper

721 Diff Diff IonutCava picture IonutCava Wed 08 Jun, 2016 15:47:49 +0000

[IonutCava]
- Spelling: change all references from our code of “color” to the PROPER British version of “colour” because it sounds 100x better

694 Diff Diff IonutCava picture IonutCava Fri 29 Apr, 2016 16:11:44 +0000

[IonutCava]
- More profile timers!
- Allow multiline localised text
- Allow font size specification for GUI.addText call

691 Diff Diff IonutCava picture IonutCava Tue 26 Apr, 2016 16:14:43 +0000

[IonutCava]
- Cleanup hash map template code (and allow creation of hash maps using the default allocator)
- Speedup text label multi-line parsing (now done on setText instead of drawText)
- Fix some reflection-related material crashes

687 Diff Diff IonutCava picture IonutCava Thu 21 Apr, 2016 20:44:41 +0000

[IonutCava]
- Fix stack overflow issue with SGN relationship cache invalidation
- Code cleanup

648 Diff Diff IonutCava picture IonutCava Sun 21 Feb, 2016 16:32:52 +0000

[IonutCava]
- Update copyright notice
- Move BoundingBox and BoundingSphere to a new BoundsComponent
— Add a temp hack in SceneGraphNode to update these

495 Diff Diff IonutCava picture IonutCava Sun 16 Aug, 2015 16:37:59 +0000

[IonutCava]
- GUI multi-line text display fixes
- AI updates

444 Diff Diff IonutCava picture IonutCava Thu 21 May, 2015 16:06:53 +0000

[Ionut]
- More platform independent code cleanup:
— Moved platform specific defines to their respective header files (e.g. THREAD_LOCAL)
— Moved most preprocessor defines from the VisualC++ projects into source code
— Removed compiler specific code (e.g. warning disables) and fixed most warning resulting from this

429 IonutCava picture IonutCava Mon 11 May, 2015 19:20:32 +0000

[Ionut]
- Added multiline GUI text rendering support
- Added GUI label to display AI state of the currently selected entity