ガラスの反射
https://scrapbox.io/files/644002132293cb001b0d3469.png
使い方
GlassReflection(Vec2 左上の位置,int32 大きさ)
用途
ゲーム内の窓や写真に貼るとガラスっぽくなります。
コード
code:ガラスの反射.cpp
# include <Siv3D.hpp>
void GlassReflection(const Vec2& pos, int32 size)
{
Triangle(pos.x, pos.y, pos.x + size * 0.85, pos.y, pos.x, pos.y + size * 0.85).draw(ColorF(1, 0), ColorF(1, 0.2), ColorF(1, 0.2));
Quad{ pos + Vec2{ size * 0.9, 0 }, pos + Vec2{ size, 0 }, pos + Vec2{ 0,size }, pos + Vec2{ 0, size * 0.9 } }.draw(ColorF(1, 0.2));
}
void Main()
{
const Texture texture{ U"example/windmill.png" };
while (System::Update())
{
texture.resized(700).draw(50, 50);
GlassReflection({ 50,50 }, 250);
}
}
#表現