LoginSignup
0
0

More than 5 years have passed since last update.

Siv3Dで透過PNGテクスチャの上端に線が入る

Last updated at Posted at 2015-02-20

問題提起

Siv3D(Jan,2015)で透過PNGテクスチャを使ってキャラクタを動かすと,なぜか上端に線が入る.テクスチャを動かすと線が入ってしまうので消したい.

解決方法

SetSamplerState関数を使い,テクスチャのアドレスモードをClampに切り替えると,上端に線が入らなくなる.

# include <Siv3D.hpp>

void Main()
{
    Graphics2D::SetSamplerState(
        SamplerState(TextureAddressMode::Clamp, TextureFilter::MinMagMipLinear));

    while (System::Update())
    {
        // hogehoge
    }
}

注意点

Siv3D(2014,Nov)以前だと,SetSamplerState関数がGraphics名前空間に入っているので,見つからない時はそちらのほうを探してみるといいかもしれません.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0