Implement Reaper of Souls Enchant. Fix text rendering bug with really small pixel values getting clamped by integer scaling causing the cached text to be cut off. Release Build 10683.
This commit is contained in:
parent
cfd73ab036
commit
9a65b731e9
@ -1000,6 +1000,10 @@
|
||||
<SubType>
|
||||
</SubType>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MonsterSoul.cpp">
|
||||
<SubType>
|
||||
</SubType>
|
||||
</ClCompile>
|
||||
<ClCompile Include="NPC.cpp">
|
||||
<SubType>
|
||||
</SubType>
|
||||
|
@ -1190,6 +1190,9 @@
|
||||
<ClCompile Include="ItemEnchant.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MonsterSoul.cpp">
|
||||
<Filter>Source Files\Effects</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="cpp.hint" />
|
||||
|
@ -371,6 +371,7 @@ void sig::Animation::InitializeAnimations(){
|
||||
|
||||
CreateStillAnimation("chain_lightning.png",{1,9});
|
||||
|
||||
CreateHorizontalAnimationSequence("monstersoul.png",3,{24,24},AnimationData{.frameDuration{0.25f},.style{Animate2D::Style::Repeat}});
|
||||
CreateHorizontalAnimationSequence("lightning_splash_effect.png",5,{24,24});
|
||||
CreateHorizontalAnimationSequence("dagger_stab.png",2,{24,24},AnimationData{.frameDuration{0.1f},.style{Animate2D::Style::PingPong}});
|
||||
CreateHorizontalAnimationSequence("goblin_sword_slash.png",3,{24,24},{0.05f,Animate2D::Style::OneShot});
|
||||
|
@ -42,6 +42,7 @@ All rights reserved.
|
||||
|
||||
INCLUDE_ANIMATION_DATA
|
||||
INCLUDE_game
|
||||
INCLUDE_GFX
|
||||
|
||||
Effect::Effect(vf2d pos,float lifetime,std::string imgFile,bool upperLevel,float size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:Effect::Effect(pos,lifetime,imgFile,upperLevel,0.f,fadeout,vf2d{size,size},spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
@ -84,13 +85,18 @@ void Effect::Draw()const{
|
||||
const bool FadeInFinished{original_fadeInTime==0||fadein==original_fadeInTime};
|
||||
const bool HasFadeout{fadeout>0};
|
||||
|
||||
if(GetZ()>0){
|
||||
vf2d shadowScale=vf2d{8*size.x/3.f,1}/std::max(1.f,GetZ()/8);
|
||||
game->view.DrawDecal(pos-vf2d{3,3}*shadowScale/2+vf2d{0,12*size.y},GFX["circle.png"].Decal(),shadowScale,BLACK);
|
||||
}
|
||||
|
||||
[[unlikely]]if(!FadeInFinished){
|
||||
game->view.DrawPartialRotatedDecal(pos,GetFrame().GetSourceImage()->Decal(),rotation,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,size,{col.r,col.g,col.b,uint8_t(fadein/original_fadeInTime*col.a)});
|
||||
game->view.DrawPartialRotatedDecal(pos-vf2d{0,GetZ()},GetFrame().GetSourceImage()->Decal(),rotation,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,size,{col.r,col.g,col.b,uint8_t(fadein/original_fadeInTime*col.a)});
|
||||
}else
|
||||
[[likely]]if(HasFadeout){
|
||||
game->view.DrawPartialRotatedDecal(pos,GetFrame().GetSourceImage()->Decal(),rotation,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,size,{col.r,col.g,col.b,uint8_t(fadeout/original_fadeOutTime*col.a)});
|
||||
game->view.DrawPartialRotatedDecal(pos-vf2d{0,GetZ()},GetFrame().GetSourceImage()->Decal(),rotation,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,size,{col.r,col.g,col.b,uint8_t(fadeout/original_fadeOutTime*col.a)});
|
||||
}else{
|
||||
game->view.DrawPartialRotatedDecal(pos,GetFrame().GetSourceImage()->Decal(),rotation,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,size,col);
|
||||
game->view.DrawPartialRotatedDecal(pos-vf2d{0,GetZ()},GetFrame().GetSourceImage()->Decal(),rotation,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,size,col);
|
||||
}
|
||||
game->SetDecalMode(DecalMode::NORMAL);
|
||||
}
|
||||
@ -105,4 +111,8 @@ bool Effect::OnUpperLevel(){
|
||||
|
||||
const EffectType Effect::GetType()const{
|
||||
return type;
|
||||
}
|
||||
|
||||
const float Effect::GetZ()const{
|
||||
return z;
|
||||
}
|
@ -62,6 +62,7 @@ struct Effect{
|
||||
float rotationSpd=0;
|
||||
vf2d scaleSpd{};
|
||||
bool additiveBlending=false;
|
||||
float z{};
|
||||
private:
|
||||
bool dead=false;
|
||||
public:
|
||||
@ -73,6 +74,7 @@ public:
|
||||
virtual void Draw()const;
|
||||
bool OnUpperLevel();
|
||||
const EffectType GetType()const;
|
||||
const float GetZ()const;
|
||||
protected:
|
||||
float original_fadeOutTime;
|
||||
float original_fadeInTime{};
|
||||
@ -141,4 +143,21 @@ struct ShineEffect:Effect{
|
||||
private:
|
||||
float fadeinTime;
|
||||
const Pixel originalCol;
|
||||
};
|
||||
|
||||
//Spawns and moves towards the player after some amount of time.
|
||||
struct MonsterSoul:Effect{
|
||||
MonsterSoul(vf2d pos,float fadeoutTime,float size,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending=false);
|
||||
virtual bool Update(float fElapsedTime)override final;
|
||||
virtual void Draw()const override final;
|
||||
public:
|
||||
enum Phase{
|
||||
RISING,
|
||||
TRACKING_PLAYER,
|
||||
DEAD,
|
||||
};
|
||||
uint8_t alpha{0U};
|
||||
Phase phase{RISING};
|
||||
float moveSpd{24.f};
|
||||
float fadeoutTime;
|
||||
};
|
@ -1001,6 +1001,8 @@ void Monster::OnDeath(){
|
||||
|
||||
if(strategyDeathFunc)GameEvent::AddEvent(std::make_unique<MonsterStrategyGameEvent>(strategyDeathFunc,*this,MONSTER_DATA[name].GetAIStrategy()));
|
||||
|
||||
if(game->GetPlayer()->HasEnchant("Reaper of Souls"))game->AddEffect(std::make_unique<MonsterSoul>(GetPos(),0.3f,GetSizeMult(),vf2d{},WHITE,0.f,0.f,false));
|
||||
|
||||
SpawnDrops();
|
||||
|
||||
game->GetPlayer()->AddAccumulatedXP(MONSTER_DATA.at(name).GetXP());
|
||||
|
89
Adventures in Lestoria/MonsterSoul.cpp
Normal file
89
Adventures in Lestoria/MonsterSoul.cpp
Normal file
@ -0,0 +1,89 @@
|
||||
#pragma region License
|
||||
/*
|
||||
License (OLC-3)
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
Copyright 2024 Joshua Sigona <sigonasr2@gmail.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions or derivations of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions or derivative works in binary form must reproduce the above
|
||||
copyright notice. This list of conditions and the following disclaimer must be
|
||||
reproduced in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
|
||||
Portions of this software are copyright © 2024 The FreeType
|
||||
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
|
||||
All rights reserved.
|
||||
*/
|
||||
#pragma endregion
|
||||
|
||||
#include "Effect.h"
|
||||
#include "util.h"
|
||||
#include "AdventuresinLestoria.h"
|
||||
#include "SoundEffect.h"
|
||||
|
||||
INCLUDE_game
|
||||
INCLUDE_GFX
|
||||
|
||||
MonsterSoul::MonsterSoul(vf2d pos,float fadeoutTime,float size,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:Effect(pos,INFINITE,"monstersoul.png",OnUpperLevel(),size,fadeoutTime,spd,col,rotation,rotationSpd,additiveBlending),fadeoutTime(fadeoutTime){}
|
||||
bool MonsterSoul::Update(float fElapsedTime){
|
||||
bool updateResult{Effect::Update(fElapsedTime)};
|
||||
switch(phase){
|
||||
case RISING:{
|
||||
if(GetZ()<10.f){
|
||||
z+=10.f*fElapsedTime;
|
||||
alpha=uint8_t(util::lerp(0,255,z/10.f));
|
||||
}else{
|
||||
phase=TRACKING_PLAYER;
|
||||
alpha=255;
|
||||
}
|
||||
}break;
|
||||
case TRACKING_PLAYER:{
|
||||
z=util::lerp(7,13,abs(sin(3*PI*lifetime)));
|
||||
moveSpd+=48.f*fElapsedTime;
|
||||
vf2d projectedPos{pos+util::pointTo(pos,game->GetPlayer()->GetPos())*moveSpd*fElapsedTime};
|
||||
geom2d::line<float>collisionLine{pos,projectedPos};
|
||||
pos=projectedPos;
|
||||
if(geom2d::overlaps(collisionLine,geom2d::circle<float>(game->GetPlayer()->GetPos(),game->GetPlayer()->GetSizeMult()*8.f))){
|
||||
lifetime=0.f;
|
||||
fadeout=fadeoutTime;
|
||||
game->GetPlayer()->Heal("Reaper of Souls"_ENC["HEALTH GAIN"]);
|
||||
game->GetPlayer()->RestoreMana("Reaper of Souls"_ENC["MANA GAIN"]);
|
||||
game->GetPlayer()->GetRightClickAbility().cooldown-="Reaper of Souls"_ENC["COOLDOWN REDUCTION"];
|
||||
game->GetPlayer()->GetAbility1().cooldown-="Reaper of Souls"_ENC["COOLDOWN REDUCTION"];
|
||||
game->GetPlayer()->GetAbility2().cooldown-="Reaper of Souls"_ENC["COOLDOWN REDUCTION"];
|
||||
game->GetPlayer()->GetAbility3().cooldown-="Reaper of Souls"_ENC["COOLDOWN REDUCTION"];
|
||||
game->GetPlayer()->GetAbility4().cooldown-="Reaper of Souls"_ENC["COOLDOWN REDUCTION"];
|
||||
SoundEffect::PlaySFX("Collect Soul",pos);
|
||||
phase=DEAD;
|
||||
}
|
||||
}break;
|
||||
}
|
||||
return updateResult;
|
||||
}
|
||||
void MonsterSoul::Draw()const{
|
||||
game->SetDecalMode(DecalMode::ADDITIVE);
|
||||
game->view.DrawRotatedDecal(pos-vf2d{0,GetZ()},GFX["monstersoulglow.png"].Decal(),0.f,GFX["monstersoulglow.png"].Sprite()->Size()/2,size*util::lerp(0.6f,1.4f,abs(sin(2*PI*lifetime))));
|
||||
game->SetDecalMode(DecalMode::NORMAL);
|
||||
Effect::Draw();
|
||||
}
|
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 2
|
||||
#define VERSION_PATCH 3
|
||||
#define VERSION_BUILD 10670
|
||||
#define VERSION_BUILD 10683
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
@ -66,6 +66,11 @@ Events
|
||||
# Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%)
|
||||
File[0] = chargeup.ogg, 70%
|
||||
}
|
||||
Collect Soul
|
||||
{
|
||||
# Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%)
|
||||
File[0] = collect_soul.ogg, 100%
|
||||
}
|
||||
Consume Potion
|
||||
{
|
||||
# Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%)
|
||||
|
@ -118,6 +118,8 @@ Images
|
||||
GFX_PoisonPool = poison_pool.png
|
||||
GFX_PoisonBottle = poison_bottle.png
|
||||
GFX_Fragment = items/Fragment.png
|
||||
GFX_MonsterSoul = monstersoul.png
|
||||
GFX_MonsterSoulGlow = monstersoulglow.png
|
||||
|
||||
GFX_Thief_Sheet = nico-thief.png
|
||||
GFX_Trapper_Sheet = nico-trapper.png
|
||||
|
Binary file not shown.
BIN
Adventures in Lestoria/assets/monstersoul.png
Normal file
BIN
Adventures in Lestoria/assets/monstersoul.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.6 KiB |
BIN
Adventures in Lestoria/assets/monstersoulglow.png
Normal file
BIN
Adventures in Lestoria/assets/monstersoulglow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
Adventures in Lestoria/assets/sounds/collect_soul.ogg
Normal file
BIN
Adventures in Lestoria/assets/sounds/collect_soul.ogg
Normal file
Binary file not shown.
@ -646,7 +646,7 @@ void olc::ViewPort::DrawStringDecal(const olc::vf2d& pos, std::string_view sText
|
||||
const bool RerenderRequired=pge->garbageCollector.count(key)&&pge->garbageCollector[key].originalStr!=renderStr;
|
||||
const bool ShadowRerenderRequired=pge->garbageCollector.count(key+"_SHADOW")&&pge->garbageCollector[key+"_SHADOW"].originalStr!=renderStr;
|
||||
if(!pge->garbageCollector.count(key)||RerenderRequired){ //If the text key already exists, don't have to recreate the decal, just update the expire time.
|
||||
vi2d imageSize=pge->GetWrappedTextSize(originalKey,width,scale);
|
||||
vf2d imageSize=pge->GetWrappedTextSize(originalKey,width,scale);
|
||||
if(imageSize.x<1||imageSize.y<1)return;
|
||||
Decal*newDecal=nullptr;
|
||||
if(!RerenderRequired){
|
||||
@ -694,7 +694,7 @@ void olc::ViewPort::DrawStringPropDecal(const olc::vf2d& pos, std::string_view s
|
||||
const bool RerenderRequired=pge->garbageCollector.count(key)&&pge->garbageCollector[key].originalStr!=renderStr;
|
||||
const bool ShadowRerenderRequired=pge->garbageCollector.count(key+"_SHADOW")&&pge->garbageCollector[key+"_SHADOW"].originalStr!=renderStr;
|
||||
if(!pge->garbageCollector.count(key)||RerenderRequired){ //If the text key already exists, don't have to recreate the decal, just update the expire time.
|
||||
vi2d imageSize=pge->GetWrappedTextSizeProp(originalKey,width,scale);
|
||||
vf2d imageSize=pge->GetWrappedTextSizeProp(originalKey,width,scale);
|
||||
if(imageSize.x<1||imageSize.y<1)return;
|
||||
Decal*newDecal=nullptr;
|
||||
if(!RerenderRequired){
|
||||
@ -726,7 +726,7 @@ void olc::ViewPort::DrawShadowStringDecal(const olc::vf2d& pos, std::string_view
|
||||
const bool RerenderRequired=pge->garbageCollector.count(key)&&pge->garbageCollector[key].originalStr!=renderStr;
|
||||
const bool ShadowRerenderRequired=pge->garbageCollector.count(key+"_SHADOW")&&pge->garbageCollector[key+"_SHADOW"].originalStr!=renderStr;
|
||||
if(!pge->garbageCollector.count(key)||RerenderRequired){ //If the text key already exists, don't have to recreate the decal, just update the expire time.
|
||||
vi2d imageSize=pge->GetWrappedTextSize(originalKey,width,scale);
|
||||
vf2d imageSize=pge->GetWrappedTextSize(originalKey,width,scale);
|
||||
if(imageSize.x<1||imageSize.y<1)return;
|
||||
Decal*newDecal=nullptr;
|
||||
if(!RerenderRequired){
|
||||
@ -778,7 +778,7 @@ void olc::ViewPort::DrawShadowStringPropDecal(const olc::vf2d& pos, std::string_
|
||||
const bool RerenderRequired=pge->garbageCollector.count(key)&&pge->garbageCollector[key].originalStr!=renderStr;
|
||||
const bool ShadowRerenderRequired=pge->garbageCollector.count(key+"_SHADOW")&&pge->garbageCollector[key+"_SHADOW"].originalStr!=renderStr;
|
||||
if(!pge->garbageCollector.count(key)||RerenderRequired){ //If the text key already exists, don't have to recreate the decal, just update the expire time.
|
||||
vi2d imageSize=pge->GetWrappedTextSizeProp(originalKey,width,scale);
|
||||
vf2d imageSize=pge->GetWrappedTextSizeProp(originalKey,width,scale);
|
||||
if(imageSize.x<1||imageSize.y<1)return;
|
||||
Decal*newDecal=nullptr;
|
||||
if(!RerenderRequired){
|
||||
|
@ -1120,8 +1120,8 @@ namespace olc
|
||||
void DrawShadowStringProp(const olc::vi2d& pos, std::string_view sText, Pixel col = olc::WHITE, const Pixel shadowCol = olc::BLACK, const olc::vf2d& scale = { 1.0f, 1.0f },const float width=std::numeric_limits<float>::max(),const float shadowSizeFactor=1);
|
||||
olc::vi2d GetTextSize(std::string_view s);
|
||||
olc::vi2d GetTextSizeProp(std::string_view s);
|
||||
olc::vi2d GetWrappedTextSize(std::string_view s,const float width=std::numeric_limits<int>::max(),const vf2d scale={1,1});
|
||||
olc::vi2d GetWrappedTextSizeProp(std::string_view s,const float width=std::numeric_limits<int>::max(),const vf2d scale={1,1});
|
||||
olc::vf2d GetWrappedTextSize(std::string_view s,const float width=std::numeric_limits<int>::max(),const vf2d scale={1,1});
|
||||
olc::vf2d GetWrappedTextSizeProp(std::string_view s,const float width=std::numeric_limits<int>::max(),const vf2d scale={1,1});
|
||||
void DrawString(const olc::vi2d& pos, std::string_view sText, Pixel col = olc::WHITE, uint32_t scale = 1,const float width=std::numeric_limits<float>::max(),const bool colorOverride=false);
|
||||
void DrawString(int32_t x, int32_t y, std::string_view sText, Pixel col = olc::WHITE, uint32_t scale = 1,const float width=std::numeric_limits<float>::max(),const bool colorOverride=false);
|
||||
|
||||
@ -3495,7 +3495,7 @@ namespace olc
|
||||
}
|
||||
const bool RerenderRequired=garbageCollector.count(key)&&garbageCollector[key].originalStr!=renderStr;
|
||||
if(!garbageCollector.count(key)||RerenderRequired){ //If the text key already exists, don't have to recreate the decal, just update the expire time.
|
||||
vi2d imageSize=GetWrappedTextSize(originalKey,width,scale);
|
||||
vf2d imageSize=GetWrappedTextSize(originalKey,width,scale);
|
||||
if(imageSize.x<1||imageSize.y<1)return;
|
||||
Decal*newDecal=nullptr;
|
||||
if(!RerenderRequired){
|
||||
@ -3527,7 +3527,7 @@ namespace olc
|
||||
}
|
||||
const bool RerenderRequired=garbageCollector.count(key)&&garbageCollector[key].originalStr!=renderStr;
|
||||
if(!garbageCollector.count(key)||RerenderRequired){ //If the text key already exists, don't have to recreate the decal, just update the expire time.
|
||||
vi2d imageSize=GetWrappedTextSizeProp(originalKey,width,scale);
|
||||
vf2d imageSize=GetWrappedTextSizeProp(originalKey,width,scale);
|
||||
if(imageSize.x<1||imageSize.y<1)return;
|
||||
Decal*newDecal=nullptr;
|
||||
if(!RerenderRequired){
|
||||
@ -3559,7 +3559,7 @@ namespace olc
|
||||
const bool RerenderRequired=garbageCollector.count(key)&&garbageCollector[key].originalStr!=renderStr;
|
||||
const bool ShadowRerenderRequired=garbageCollector.count(key+"_SHADOW")&&garbageCollector[key+"_SHADOW"].originalStr!=renderStr;
|
||||
if(!garbageCollector.count(key)||RerenderRequired){ //If the text key already exists, don't have to recreate the decal, just update the expire time.
|
||||
vi2d imageSize=GetWrappedTextSize(originalKey,width,scale);
|
||||
vf2d imageSize=GetWrappedTextSize(originalKey,width,scale);
|
||||
if(imageSize.x<1||imageSize.y<1)return;
|
||||
Decal*newDecal=nullptr;
|
||||
if(!RerenderRequired){
|
||||
@ -3669,7 +3669,7 @@ namespace olc
|
||||
const bool RerenderRequired=garbageCollector.count(key)&&garbageCollector[key].originalStr!=renderStr;
|
||||
const bool ShadowRerenderRequired=garbageCollector.count(key+"_SHADOW")&&garbageCollector[key+"_SHADOW"].originalStr!=renderStr;
|
||||
if(!garbageCollector.count(key)||RerenderRequired){ //If the text key already exists, don't have to recreate the decal, just update the expire time.
|
||||
vi2d imageSize=GetWrappedTextSizeProp(originalKey,width,scale);
|
||||
vf2d imageSize=GetWrappedTextSizeProp(originalKey,width,scale);
|
||||
if(imageSize.x<1||imageSize.y<1)return;
|
||||
Decal*newDecal=nullptr;
|
||||
if(!RerenderRequired){
|
||||
@ -3799,7 +3799,7 @@ namespace olc
|
||||
DrawRotatedStringPropDecal(pos, sText,fAngle,center,col,scale);
|
||||
}
|
||||
|
||||
olc::vi2d PixelGameEngine::GetWrappedTextSize(std::string_view s,const float width,const vf2d scale)
|
||||
olc::vf2d PixelGameEngine::GetWrappedTextSize(std::string_view s,const float width,const vf2d scale)
|
||||
{
|
||||
float adjustedWidth=width;
|
||||
if(width!=std::numeric_limits<float>::max()){
|
||||
@ -3877,7 +3877,7 @@ namespace olc
|
||||
}
|
||||
drawingMarker.x += lettersWidth;
|
||||
maxWidth=std::max(maxWidth,drawingMarker.x);
|
||||
return vi2d(vf2d{maxWidth,planningMarker.y+8}*scale);
|
||||
return vf2d{maxWidth,planningMarker.y+8}*scale;
|
||||
}
|
||||
|
||||
olc::vi2d PixelGameEngine::GetTextSize(std::string_view s)
|
||||
@ -4060,7 +4060,7 @@ namespace olc
|
||||
return size;
|
||||
}
|
||||
|
||||
olc::vi2d PixelGameEngine::GetWrappedTextSizeProp(std::string_view s,const float width,const vf2d scale)
|
||||
olc::vf2d PixelGameEngine::GetWrappedTextSizeProp(std::string_view s,const float width,const vf2d scale)
|
||||
{
|
||||
float adjustedWidth=width;
|
||||
if(width!=std::numeric_limits<float>::max()){
|
||||
@ -4138,7 +4138,7 @@ namespace olc
|
||||
}
|
||||
drawingMarker.x += lettersWidth;
|
||||
maxWidth=std::max(maxWidth,drawingMarker.x);
|
||||
return vi2d(vf2d{maxWidth,planningMarker.y+8}*scale);
|
||||
return vf2d{maxWidth,planningMarker.y+8}*scale;
|
||||
}
|
||||
|
||||
void PixelGameEngine::DrawStringProp(const olc::vi2d& pos, std::string_view sText, Pixel col, uint32_t scale,const float width,const bool colorOverride)
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user