MCPcopy Create free account
hub / github.com/EasyRPG/Player / Draw

Method Draw

src/dynrpg_textplugin.cpp:110–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108 }
109
110 void Draw(Bitmap& dst) override {
111 if (!bitmap) {
112 return;
113 }
114
115 const Game_Pictures::Picture* pic = Main_Data::game_pictures->GetPicturePtr(pic_id);
116 if (!pic) {
117 return;
118 }
119 const Sprite_Picture* sprite = pic->sprite.get();
120 if (!sprite) {
121 return;
122 }
123
124 // For unknown reasons the official plugin has an y-offset of 2
125 if (fixed) {
126 dst.Blit(x - Game_Map::GetDisplayX() / 16, y - Game_Map::GetDisplayY() / 16 + 2, *bitmap, bitmap->GetRect(), sprite->GetOpacity());
127 } else {
128 dst.Blit(x, y + 2, *bitmap, bitmap->GetRect(), sprite->GetOpacity());
129 }
130 };
131
132 void Update() {
133 if (GetZ() == 0) {

Callers

nothing calls this directly

Calls 5

GetPicturePtrMethod · 0.80
BlitMethod · 0.80
GetRectMethod · 0.80
getMethod · 0.45
GetOpacityMethod · 0.45

Tested by

no test coverage detected