Fixed crooked lines

master
sigonasr2 9 months ago
parent 50562dbf5c
commit aed51eeab9
  1. 27
      TiledCollisionEditor/main.cpp
  2. BIN
      TiledCollisionEditor/rollingcounter.png

@ -26,6 +26,8 @@ public:
sAppName = "TiledCollisionEditor"; sAppName = "TiledCollisionEditor";
} }
Renderable rollingCounter;
public: public:
bool OnUserCreate() override bool OnUserCreate() override
{ {
@ -34,6 +36,8 @@ public:
std::string tilesetFilename=TILESET_DIR+"Basic Tileset.tsx"; std::string tilesetFilename=TILESET_DIR+"Basic Tileset.tsx";
Tileset&tileset=tilesets[tilesetFilename]=TSXParser{tilesetFilename}.GetData(); Tileset&tileset=tilesets[tilesetFilename]=TSXParser{tilesetFilename}.GetData();
rollingCounter.Load("rollingcounter.png",nullptr,false,false);
Renderable&tilesetImg=images[tilesetFilename]; Renderable&tilesetImg=images[tilesetFilename];
tilesetImg.Load(TILESET_DIR+tileset.filename); tilesetImg.Load(TILESET_DIR+tileset.filename);
@ -41,10 +45,17 @@ public:
return true; return true;
} }
float hundredsDigit=0.f;
float tensDigit=0.f;
float onesDigit=0.f;
float currentHealth=0;
float targetHealth=60;
bool OnUserUpdate(float fElapsedTime) override bool OnUserUpdate(float fElapsedTime) override
{ {
Clear(VERY_DARK_BLUE); Clear(VERY_DARK_BLUE);
/*
view.HandlePanAndZoom(); view.HandlePanAndZoom();
const Tileset&tileset=tilesets[activeTileset]; const Tileset&tileset=tilesets[activeTileset];
@ -62,10 +73,10 @@ public:
} }
for(auto&[objName,obj]:tileset.objects){ for(auto&[objName,obj]:tileset.objects){
view.DrawLineDecal(obj.bounds.pos,obj.bounds.pos+vf2d{2.f,float(obj.bounds.size.y)},YELLOW); view.DrawLineDecal(obj.bounds.pos,obj.bounds.pos+vf2d{0.f,float(obj.bounds.size.y)},YELLOW);
view.DrawLineDecal(obj.bounds.pos,obj.bounds.pos+vf2d{float(obj.bounds.size.x),2},YELLOW); view.DrawLineDecal(obj.bounds.pos,obj.bounds.pos+vf2d{float(obj.bounds.size.x),0.f},YELLOW);
view.DrawLineDecal(obj.bounds.pos+obj.bounds.size,obj.bounds.pos+obj.bounds.size+vf2d{-2.f,-float(obj.bounds.size.y)},YELLOW); view.DrawLineDecal(obj.bounds.pos+obj.bounds.size,obj.bounds.pos+obj.bounds.size+vf2d{0.f,-float(obj.bounds.size.y)},YELLOW);
view.DrawLineDecal(obj.bounds.pos+obj.bounds.size,obj.bounds.pos+obj.bounds.size+vf2d{-float(obj.bounds.size.x),-2.f},YELLOW); view.DrawLineDecal(obj.bounds.pos+obj.bounds.size,obj.bounds.pos+obj.bounds.size+vf2d{-float(obj.bounds.size.x),0.f},YELLOW);
vi2d nameTextSize=GetTextSizeProp(objName)*0.25f; vi2d nameTextSize=GetTextSizeProp(objName)*0.25f;
view.GradientFillRectDecal(obj.bounds.pos,nameTextSize+vf2d{2,2},RED,{255,0,0,64},{255,0,0,64},RED); view.GradientFillRectDecal(obj.bounds.pos,nameTextSize+vf2d{2,2},RED,{255,0,0,64},{255,0,0,64},RED);
@ -127,13 +138,13 @@ public:
view.DrawPolygonDecal(nullptr,points,uvs,cols); view.DrawPolygonDecal(nullptr,points,uvs,cols);
} }
} }
*/
//Font test. /* //Font test.
DrawStringDecal({0,0},"the quick brown fox jumps over the lazy dog 1234567890 !@#$%^&*()-=_+[]{}\\;':\",./<>?~`",WHITE,{1.5f,1.5f}); DrawStringDecal({0,0},"the quick brown fox jumps over the lazy dog 1234567890 !@#$%^&*()-=_+[]{}\\;':\",./<>?~`",WHITE,{1.5f,1.5f});
DrawStringDecal({0,18},"THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG 1234567890 !@#$%^&*()-=_+[]{}\\;':\",./<>?~`",WHITE,{1.5f,1.5f}); DrawStringDecal({0,18},"THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG 1234567890 !@#$%^&*()-=_+[]{}\\;':\",./<>?~`",WHITE,{1.5f,1.5f});
DrawStringPropDecal({0,36},"the quick brown fox jumps over the lazy dog 1234567890 !@#$%^&*()-=_+[]{}\\;':\",./<>?~`",WHITE,{1.5f,1.5f}); DrawStringPropDecal({0,36},"the quick brown fox jumps over the lazy dog 1234567890 !@#$%^&*()-=_+[]{}\\;':\",./<>?~`",WHITE,{1.5f,1.5f});
DrawStringPropDecal({0,54},"THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG 1234567890 !@#$%^&*()-=_+[]{}\\;':\",./<>?~`",WHITE,{1.5f,1.5f}); DrawStringPropDecal({0,54},"THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG 1234567890 !@#$%^&*()-=_+[]{}\\;':\",./<>?~`",WHITE,{1.5f,1.5f});
*/
return true; return true;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Loading…
Cancel
Save