Earthbound font

master
sigonasr2 9 months ago
parent 6d0aa870c0
commit 50562dbf5c
  1. 810
      TiledCollisionEditor/Tiles/Basic Tileset.tsx
  2. BIN
      TiledCollisionEditor/Tiles/tilemap-3-normal.png
  3. BIN
      TiledCollisionEditor/font.png
  4. BIN
      TiledCollisionEditor/font2.png
  5. BIN
      TiledCollisionEditor/font3.png
  6. 28
      TiledCollisionEditor/main.cpp
  7. 46
      TiledCollisionEditor/pixelGameEngine.h

@ -0,0 +1,810 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.10" tiledversion="1.10.2" name="Basic Tileset" tilewidth="16" tileheight="16" tilecount="864" columns="32">
<transformations hflip="1" vflip="1" rotate="0" preferuntransformed="0"/>
<image source="tilemap-3-normal.png" width="512" height="432"/>
<tile id="3" type="Object">
<properties>
<property name="Name" value="Stop Sign"/>
</properties>
</tile>
<tile id="4" type="Object">
<properties>
<property name="Name" value="Stop Sign"/>
</properties>
</tile>
<tile id="8" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="9" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="10" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="11" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="12" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="13" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="14" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="15" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="16" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="17" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="18" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="19" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="20" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="21" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="22" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="23" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="24" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="35" type="Object">
<properties>
<property name="Name" value="Stop Sign"/>
</properties>
</tile>
<tile id="36" type="Object">
<properties>
<property name="Name" value="Stop Sign"/>
</properties>
</tile>
<tile id="40" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="41" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="42" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="43" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="44" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="45" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="46" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="47" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="48" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="49" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="50" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="51" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="52" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="53" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="54" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="55" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="56" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="67" type="Object">
<properties>
<property name="Name" value="Stop Sign"/>
</properties>
</tile>
<tile id="68" type="Object">
<properties>
<property name="Name" value="Stop Sign"/>
</properties>
</tile>
<tile id="72" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="73" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="74" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="75" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="76" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="77" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="78" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="79" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="80" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="81" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="82" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="83" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="84" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="85" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="86" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="87" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="88" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="99" type="Object">
<properties>
<property name="Name" value="Stop Sign"/>
</properties>
</tile>
<tile id="100" type="Object">
<properties>
<property name="Name" value="Stop Sign"/>
</properties>
</tile>
<tile id="104" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="105" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="106" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="107" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="108" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="109" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="110" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="111" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="112" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="113" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="114" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="115" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="116" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="117" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="118" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="119" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="120" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="136" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="137" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="138" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="139" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="140" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="141" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="142" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="143" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="144" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="145" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="146" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="147" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="148" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="149" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="150" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="151" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="152" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="168" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="169" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="170" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="171" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="172" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="173" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="174" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="175" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="176" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="177" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="178" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="179" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="180" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="181" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="182" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="183" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="184" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="200" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="201" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="202" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="203" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="204" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="205" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="206" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="207" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="208" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="209" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="210" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="211" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="212" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="213" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="214" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="215" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="216" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="232" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="233" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="234" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="235" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="236" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="237" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="238" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="239" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="240" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="241" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="242" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="243" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="244" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="245" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="246" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="247" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="248" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="264" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="265" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="266" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="267" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="268" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="269" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="270" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="271" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="272" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="273" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="274" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="275" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="276" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="277" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="278" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="279" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
<tile id="280" type="PerspectiveObject">
<properties>
<property name="Name" value="BlueHouse1"/>
</properties>
</tile>
</tileset>

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -6,7 +6,7 @@
using namespace olc; using namespace olc;
using namespace olc::utils; using namespace olc::utils;
const std::string TILESET_DIR="./assets/Tiles/"; const std::string TILESET_DIR="./Tiles/";
class TiledCollisionEditor : public olc::PixelGameEngine class TiledCollisionEditor : public olc::PixelGameEngine
{ {
@ -29,7 +29,7 @@ public:
public: public:
bool OnUserCreate() override bool OnUserCreate() override
{ {
SetFontSprite("assets/font.png"); SetFontSprite("font3.png");
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();
@ -44,7 +44,7 @@ public:
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,17 +62,17 @@ public:
} }
for(auto&[objName,obj]:tileset.objects){ for(auto&[objName,obj]:tileset.objects){
view.FillRectDecal(obj.bounds.pos,vf2d{2.f,float(obj.bounds.size.y)},YELLOW); view.DrawLineDecal(obj.bounds.pos,obj.bounds.pos+vf2d{2.f,float(obj.bounds.size.y)},YELLOW);
view.FillRectDecal(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),2},YELLOW);
view.FillRectDecal(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{-2.f,-float(obj.bounds.size.y)},YELLOW);
view.FillRectDecal(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),-2.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);
view.DrawStringPropDecal(obj.bounds.pos+vf2d{1.25f,1.25f},objName,BLACK,vf2d{0.25f,0.25f}); view.DrawStringPropDecal(obj.bounds.pos+vf2d{1.25f,1.25f},objName,BLACK,vf2d{0.25f,0.25f});
view.DrawStringPropDecal(obj.bounds.pos+vf2d{1,1},objName,WHITE,vf2d{0.25f,0.25f}); view.DrawStringPropDecal(obj.bounds.pos+vf2d{1,1},objName,WHITE,vf2d{0.25f,0.25f});
if(geom2d::contains(obj.bounds,GetMousePos())){ if(geom2d::contains(obj.bounds,view.ScreenToWorld(GetMousePos()))){
selectedObj=objName; selectedObj=objName;
} }
} }
@ -127,13 +127,13 @@ public:
view.DrawPolygonDecal(nullptr,points,uvs,cols); view.DrawPolygonDecal(nullptr,points,uvs,cols);
} }
} }
/* Font test.
DrawStringDecal({0,0},"the quick brown fox jumps over the lazy dog",WHITE,{1.5f,1.5f});
DrawStringDecal({0,18},"THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG",WHITE,{1.5f,1.5f});
DrawStringPropDecal({0,36},"the quick brown fox jumps over the lazy dog",WHITE,{1.5f,1.5f});
DrawStringPropDecal({0,54},"THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG",WHITE,{1.5f,1.5f});
*/ */
//Font test.
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});
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});
return true; return true;
} }

@ -3303,18 +3303,18 @@ namespace olc
{ {
if (c == '\n') if (c == '\n')
{ {
spos.x = 0; spos.y += 8.0f * scale.y; spos.x = 0; spos.y += 16.0f * scale.y;
} }
else if (c == '\t') else if (c == '\t')
{ {
spos.x += 8.0f * float(nTabSizeInSpaces) * scale.x; spos.x += 16.0f * float(nTabSizeInSpaces) * scale.x;
} }
else else
{ {
int32_t ox = (c - 32) % 16; int32_t ox = (c - 32) % 16;
int32_t oy = (c - 32) / 16; int32_t oy = (c - 32) / 16;
DrawPartialDecal(pos + spos, fontRenderable.Decal(), {float(ox) * 8.0f, float(oy) * 8.0f}, {8.0f, 8.0f}, scale, col); DrawPartialDecal(pos + spos, fontRenderable.Decal(), {float(ox) * 16.0f, float(oy) * 16.0f}, {16.0f, 16.0f}, scale, col);
spos.x += 8.0f * scale.x; spos.x += 16.0f * scale.x;
} }
} }
} }
@ -3326,17 +3326,17 @@ namespace olc
{ {
if (c == '\n') if (c == '\n')
{ {
spos.x = 0; spos.y += 8.0f * scale.y; spos.x = 0; spos.y += 16.0f * scale.y;
} }
else if (c == '\t') else if (c == '\t')
{ {
spos.x += 8.0f * float(nTabSizeInSpaces) * scale.x; spos.x += 16.0f * float(nTabSizeInSpaces) * scale.x;
} }
else else
{ {
int32_t ox = (c - 32) % 16; int32_t ox = (c - 32) % 16;
int32_t oy = (c - 32) / 16; int32_t oy = (c - 32) / 16;
DrawPartialDecal(pos + spos, fontRenderable.Decal(), { float(ox) * 8.0f + float(vFontSpacing[c - 32].x), float(oy) * 8.0f }, { float(vFontSpacing[c - 32].y), 8.0f }, scale, col); DrawPartialDecal(pos + spos, fontRenderable.Decal(), { float(ox) * 16.0f + float(vFontSpacing[c - 32].x), float(oy) * 16.0f }, { float(vFontSpacing[c - 32].y), 16.0f }, scale, col);
spos.x += float(vFontSpacing[c - 32].y) * scale.x; spos.x += float(vFontSpacing[c - 32].y) * scale.x;
} }
} }
@ -3349,18 +3349,18 @@ namespace olc
{ {
if (c == '\n') if (c == '\n')
{ {
spos.x = center.x; spos.y -= 8.0f; spos.x = center.x; spos.y -= 16.0f;
} }
else if (c == '\t') else if (c == '\t')
{ {
spos.x += 8.0f * float(nTabSizeInSpaces) * scale.x; spos.x += 16.0f * float(nTabSizeInSpaces) * scale.x;
} }
else else
{ {
int32_t ox = (c - 32) % 16; int32_t ox = (c - 32) % 16;
int32_t oy = (c - 32) / 16; int32_t oy = (c - 32) / 16;
DrawPartialRotatedDecal(pos, fontRenderable.Decal(), fAngle, spos, { float(ox) * 8.0f, float(oy) * 8.0f }, { 8.0f, 8.0f }, scale, col); DrawPartialRotatedDecal(pos, fontRenderable.Decal(), fAngle, spos, { float(ox) * 16.0f, float(oy) * 16.0f }, { 16.0f, 16.0f }, scale, col);
spos.x -= 8.0f; spos.x -= 16.0f;
} }
} }
} }
@ -3372,17 +3372,17 @@ namespace olc
{ {
if (c == '\n') if (c == '\n')
{ {
spos.x = center.x; spos.y -= 8.0f; spos.x = center.x; spos.y -= 16.0f;
} }
else if (c == '\t') else if (c == '\t')
{ {
spos.x += 8.0f * float(nTabSizeInSpaces) * scale.x; spos.x += 16.0f * float(nTabSizeInSpaces) * scale.x;
} }
else else
{ {
int32_t ox = (c - 32) % 16; int32_t ox = (c - 32) % 16;
int32_t oy = (c - 32) / 16; int32_t oy = (c - 32) / 16;
DrawPartialRotatedDecal(pos, fontRenderable.Decal(), fAngle, spos, { float(ox) * 8.0f + float(vFontSpacing[c - 32].x), float(oy) * 8.0f }, { float(vFontSpacing[c - 32].y), 8.0f }, scale, col); DrawPartialRotatedDecal(pos, fontRenderable.Decal(), fAngle, spos, { float(ox) * 16.0f + float(vFontSpacing[c - 32].x), float(oy) * 16.0f }, { float(vFontSpacing[c - 32].y), 16.0f }, scale, col);
spos.x -= float(vFontSpacing[c - 32].y); spos.x -= float(vFontSpacing[c - 32].y);
} }
} }
@ -3629,11 +3629,11 @@ namespace olc
// Draw the console buffer // Draw the console buffer
SetDecalMode(olc::DecalMode::NORMAL); SetDecalMode(olc::DecalMode::NORMAL);
for (int32_t nLine = 0; nLine < vConsoleSize.y; nLine++) for (int32_t nLine = 0; nLine < vConsoleSize.y; nLine++)
DrawStringDecal(olc::vf2d( 1, 1 + float(nLine) ) * vConsoleCharacterScale * 8.0f, sConsoleLines[nLine], olc::WHITE, vConsoleCharacterScale); DrawStringDecal(olc::vf2d( 1, 1 + float(nLine) ) * vConsoleCharacterScale * 16.0f, sConsoleLines[nLine], olc::WHITE, vConsoleCharacterScale);
// Draw Input State // Draw Input State
FillRectDecal(olc::vf2d(1 + float((TextEntryGetCursor() + 1)), 1 + float((vConsoleSize.y - 1))) * vConsoleCharacterScale * 8.0f, olc::vf2d(8, 8) * vConsoleCharacterScale, olc::DARK_CYAN); FillRectDecal(olc::vf2d(1 + float((TextEntryGetCursor() + 1)), 1 + float((vConsoleSize.y - 1))) * vConsoleCharacterScale * 16.0f, olc::vf2d(8, 8) * vConsoleCharacterScale, olc::DARK_CYAN);
DrawStringDecal(olc::vf2d(1, 1 + float((vConsoleSize.y - 1))) * vConsoleCharacterScale * 8.0f, std::string(">") + TextEntryGetString(), olc::YELLOW, vConsoleCharacterScale); DrawStringDecal(olc::vf2d(1, 1 + float((vConsoleSize.y - 1))) * vConsoleCharacterScale * 16.0f, std::string(">") + TextEntryGetString(), olc::YELLOW, vConsoleCharacterScale);
} }
@ -4071,12 +4071,12 @@ namespace olc
fontRenderable.Decal()->Update(); fontRenderable.Decal()->Update();
constexpr std::array<uint8_t, 96> vSpacing = { { constexpr std::array<uint8_t, 96> vSpacing = { {
0x03,0x16,0x34,0x16,0x16,0x08,0x16,0x43,0x34,0x14,0x16,0x16,0x13,0x16,0x33,0x08, 0x03,0x02,0x04,0x03,0x06,0x0B,0x0A,0x03,0x04,0x04,0x04,0x06,0x03,0x03,0x03,0x05,
0x08,0x17,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x24,0x15,0x06,0x07,0x16,0x17, 0x06,0x05,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x02,0x03,0x05,0x06,0x05,0x05,
0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x17,0x08,0x08,0x17,0x08,0x08,0x08, 0x05,0x07,0x06,0x06,0x06,0x05,0x05,0x06,0x06,0x02,0x05,0x06,0x05,0x08,0x06,0x06,
0x08,0x08,0x08,0x08,0x17,0x08,0x08,0x08,0x08,0x17,0x08,0x33,0x08,0x23,0x16,0x08, 0x06,0x06,0x06,0x06,0x06,0x06,0x07,0x08,0x06,0x06,0x05,0x06,0x05,0x07,0x05,0x06,
0x13,0x16,0x16,0x17,0x16,0x16,0x15,0x17,0x17,0x33,0x15,0x17,0x23,0x08,0x17,0x16, 0x03,0x06,0x05,0x05,0x05,0x05,0x04,0x05,0x05,0x02,0x03,0x05,0x02,0x08,0x05,0x05,
0x07,0x07,0x24,0x17,0x24,0x17,0x16,0x08,0x23,0x17,0x17,0x25,0x32,0x15,0x07,0x00, } }; 0x05,0x05,0x04,0x05,0x04,0x05,0x06,0x08,0x05,0x05,0x05,0x03,0x06,0x03,0x07,0x08, } };
for (auto c : vSpacing) vFontSpacing.push_back({ c >> 4, c & 15 }); for (auto c : vSpacing) vFontSpacing.push_back({ c >> 4, c & 15 });

Loading…
Cancel
Save