GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
CommentEvent.h
1 /*
2  * GDevelop Core
3  * Copyright 2008-2016 Florian Rival ([email protected]). All rights
4  * reserved. This project is released under the MIT License.
5  */
6 #ifndef COMMENTEVENT_H
7 #define COMMENTEVENT_H
8 
9 #include "GDCore/Events/Event.h"
10 #include "GDCore/Events/EventsList.h"
11 namespace gd {
12 class Layout;
13 class Project;
14 } // namespace gd
15 
16 namespace gd {
17 
21 class GD_CORE_API CommentEvent : public gd::BaseEvent {
22  public:
23  CommentEvent()
24  : BaseEvent(), r(255), v(230), b(109), textR(0), textG(0), textB(0){};
25  virtual ~CommentEvent(){};
26  virtual gd::CommentEvent* Clone() const { return new CommentEvent(*this); }
27 
28  int GetBackgroundColorRed() const { return r; }
29  int GetBackgroundColorGreen() const { return v; }
30  int GetBackgroundColorBlue() const { return b; }
31  void SetBackgroundColor(int r_, int g_, int b_) {
32  r = r_;
33  v = g_;
34  b = b_;
35  }
36 
37  int GetTextColorRed() const { return textR; }
38  int GetTextColorGreen() const { return textG; }
39  int GetTextColorBlue() const { return textB; }
40  void SetTextColor(int r_, int g_, int b_) {
41  textR = r_;
42  textG = g_;
43  textB = b_;
44  }
45 
46  const gd::String& GetComment() const { return com1; }
47  void SetComment(const gd::String& comment) { com1 = comment; }
48 
49  virtual std::vector<gd::String> GetAllSearchableStrings() const;
50  virtual bool ReplaceAllSearchableStrings(
51  std::vector<gd::String> newSearchableString);
52 
53  virtual void SerializeTo(SerializerElement& element) const;
54  virtual void UnserializeFrom(gd::Project& project,
55  const SerializerElement& element);
56 
57  int r;
58  int v;
59  int b;
60 
61  int textR;
62  int textG;
63  int textB;
64 
67 };
68 
69 } // namespace gd
70 
71 #endif // COMMENTEVENT_H
Base class defining an event.
Definition: Event.h:43
Allows to add a text in the events editor.
Definition: CommentEvent.h:21
int b
Background color Blue component.
Definition: CommentEvent.h:59
int textB
Text color Blue component.
Definition: CommentEvent.h:63
gd::String com1
Comment.
Definition: CommentEvent.h:65
gd::String com2
Optional second column comment, deprecated.
Definition: CommentEvent.h:66
virtual gd::CommentEvent * Clone() const
Definition: CommentEvent.h:26
int r
Background color Red component.
Definition: CommentEvent.h:57
int textG
Text color Green component.
Definition: CommentEvent.h:62
int textR
Text color Red component.
Definition: CommentEvent.h:61
int v
Background color Green component.
Definition: CommentEvent.h:58
Base class representing a project (game), including all resources, scenes, objects,...
Definition: Project.h:51
String represents an UTF8 encoded string.
Definition: String.h:33
Definition: CommonTools.h:24