Oxygine  1
2g game engine
WebImage.h
1 #pragma once
2 #include "oxygine-include.h"
3 #include "Actor.h"
4 #include "res/ResAnim.h"
5 #include "HttpRequestTask.h"
6 #include <string>
7 
8 namespace oxygine
9 {
10  DECLARE_SMART(WebImage, spWebImage);
11  class WebImage : public Actor
12  {
13  INHERITED(Actor);
14  public:
15  DECLARE_COPYCLONE_NEW(WebImage);
16 
17  WebImage();
18  ~WebImage();
19 
20  void load(const std::string& url);
21  void load(spHttpRequestTask task);
22  void unload();
23 
24  void serialize(serializedata*) override;
25  void deserialize(const deserializedata*) override;
26 
27  private:
28  void _load(spHttpRequestTask task);
29 
30  void loaded(Event*);
31  void error(Event*);
32  void sizeChanged(const Vector2& size) override;
33  void fit();
34 
35  void init();
36 
37  ResAnim _rs;
38 
39  spSprite _image;
40 
41  spHttpRequestTask _http;
42  bool _allowSwap;
43  };
44 }
45 
46 EDITOR_INCLUDE(WebImage);
Definition: Serialize.h:28
Definition: Actor.h:42
Definition: Event.h:10
Definition: Serialize.h:21
–oxgl-end–!
Definition: Actor.h:14
Definition: ResAnim.h:13
Definition: WebImage.h:11