Skip to content

Instantly share code, notes, and snippets.

@ongaeshi
Created June 25, 2020 13:59
Show Gist options
  • Save ongaeshi/7db87ac900f70a6417d741042ddbbc37 to your computer and use it in GitHub Desktop.
Save ongaeshi/7db87ac900f70a6417d741042ddbbc37 to your computer and use it in GitHub Desktop.
# include <Siv3D.hpp> // OpenSiv3D v0.4.3
void Main()
{
const std::array<Texture, 3> textures =
{
Texture(Emoji(U"😊")),
Texture(Emoji(U"πŸ˜’")),
Texture(Emoji(U"πŸ˜‚")),
};
constexpr Size imageSize = Emoji::ImageSize;
while (System::Update())
{
Rect(0, 300, 800, 300).draw(ColorF(0.2, 0.3, 0.4));
for (auto [i, texture] : Indexed(textures))
{
const Vec2 pos(140 + i * 200, 220);
texture.draw(pos);
// 反射するテクスチャ
texture(0, imageSize.y * 0.25, imageSize.x, imageSize.y * 0.75).flipped()
.draw(pos.x, pos.y + imageSize.y,
Arg::top = AlphaF(0.5), Arg::bottom = AlphaF(0.0));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment