东方弹幕风吧 关注:263贴子:936
  • 10回复贴,共1

弹幕风作图 特效

只看楼主收藏回复



1楼2013-03-06 16:11回复
    #TouhouDanmakufu
    #Title[Drawing2D]
    #Text[Drawing2D Test]
    #PlayLevel[Easy]
    #Player[FREE]
    #ScriptVersion[2]
    script_enemy_main
    {
    let alpha = 255;
    let angle = 360;
    let scale = 2;
    let flag = 0;
    let carriage = GetCurrentScriptDirectory~"\img\carriage.bmp";
    let turret = GetCurrentScriptDirectory~"\img\turret.bmp";
    @Initialize
    {
    SetX(GetCenterX);
    SetY(GetClipMinY + 100);
    LoadGraphic(carriage);
    LoadGraphic(turret);
    SetLife(2000);
    }
    @MainLoop
    {
    SetCollisionA(GetCenterX, 100, 16);
    }
    @DrawLoop
    {
    SetTexture(carriage);
    SetGraphicRect(0, 0, 32, 32);
    SetAlpha(255);
    SetGraphicAngle(0, 0, 0);
    SetGraphicScale(1, 1);
    DrawGraphic(GetCenterX, 100);
    SetTexture(turret);
    SetGraphicRect(0, 0, 34, 34);
    SetAlpha(alpha);
    SetGraphicAngle(0, 0, angle);
    SetGraphicScale(1, 1);
    DrawGraphic(GetCenterX, 100);
    DrawText("Alpha", GetCenterX-16, 160, 12, 255);
    SetTexture(carriage);
    SetGraphicRect(0, 0, 32, 32);
    SetAlpha(255);
    SetGraphicAngle(0, 0, 0);
    SetGraphicScale(2, 2);
    DrawGraphic(100, 100);
    SetTexture(turret);
    SetGraphicRect(0, 0, 34, 34);
    SetAlpha(255);
    SetGraphicAngle(0, 0, angle);
    SetGraphicScale(scale, scale);
    DrawGraphic(100, 100);
    DrawText("Scale", 100-16, 160, 12, 255);
    SetTexture(carriage);
    SetGraphicRect(0, 0, 32*2, 32*2);
    SetAlpha(255);
    SetGraphicAngle(0, 0, 0);
    SetGraphicScale(1, 1);
    DrawGraphic(348, 100);
    SetTexture(turret);
    SetGraphicRect(0, 0, 34, 34);
    SetAlpha(255);
    SetGraphicAngle(0, 0, angle);
    SetGraphicScale(1, 1);
    DrawGraphic(348+16, 100-16);
    DrawGraphic(348-16, 100-16);
    DrawGraphic(348-16, 100+16);
    DrawGraphic(348+16, 100+16);
    DrawText("Tile", 348-16, 160, 12, 255);
    DrawText("alpha =", 70, 200, 12, 255);
    DrawText(alpha, 115, 200, 12, 255);
    DrawText("scale =", 70, 220, 12, 255);
    DrawText(scale, 115, 220, 12, 255);
    DrawText("angle =", 70, 240, 12, 255);
    DrawText(angle, 115, 240, 12, 255);
    angle -= 0.75;
    if(0 == angle)
    {
    angle = 360;
    }
    if(0 == flag)
    {
    alpha -= 8.5;
    scale -= 0.06;
    if(alpha <= 0)
    {
    flag = 1;
    }
    }
    else
    {
    alpha += 8.5;
    scale += 0.06;
    if(alpha >= 255)
    {
    flag = 0;
    }
    }
    }
    @Finalize
    {
    DeleteGraphic(carriage);
    DeleteGraphic(turret);
    }
    }


    2楼2013-03-06 16:14
    回复
      #TouhouDanmakufu[Stage]
      #Title[Drawing3D_1]
      #Text[Drawing3D Test 1]
      #PlayLevel[Easy]
      #Player[FREE]
      #ScriptVersion[2]
      script_stage_main
      {
      let xangle = 0;
      let yangle = 0;
      let zangle = 0;
      let tangle = 180;
      let carriage = GetCurrentScriptDirectory~"\img\carriage.png";
      let turret = GetCurrentScriptDirectory~"\img\turret.png";
      @Initialize
      {
      LoadGraphic(carriage);
      LoadGraphic(turret);
      }
      @MainLoop
      {
      }
      @BackGround
      {
      SetViewFrom(500, 90, 0);
      SetTexture(carriage);
      SetGraphicRect(0, 0, 32, 32);
      SetAlpha(255);
      SetGraphicAngle(0, 0, zangle);
      SetGraphicScale(2, 2);
      DrawGraphic3D(0, 0, 0);
      SetTexture(turret);
      SetGraphicRect(0, 0, 34, 34);
      SetAlpha(255);
      SetGraphicAngle(0, 0, tangle);
      SetGraphicScale(2, 2);
      DrawGraphic3D(0, 0, 0);
      SetTexture(carriage);
      SetGraphicRect(0, 0, 32, 32);
      SetAlpha(255);
      SetGraphicAngle(0, yangle, 0);
      SetGraphicScale(2, 2);
      DrawGraphic3D(-110, 0, 0);
      SetTexture(turret);
      SetGraphicRect(0, 0, 34, 34);
      SetAlpha(255);
      SetGraphicAngle(0, yangle, tangle);
      SetGraphicScale(2, 2);
      DrawGraphic3D(-110, 0, 0);
      SetTexture(carriage);
      SetGraphicRect(0, 0, 32, 32);
      SetAlpha(255);
      SetGraphicAngle(xangle, 0, 0);
      SetGraphicScale(2, 2);
      DrawGraphic3D(110, 0, 0);
      SetTexture(turret);
      SetGraphicRect(0, 0, 34, 34);
      SetAlpha(255);
      SetGraphicAngle(xangle, 0, tangle);
      SetGraphicScale(2, 2);
      DrawGraphic3D(110, 0, 0);
      xangle += 0.75;
      yangle += 0.75;
      zangle += 0.75;
      tangle += 3;
      if(360 == xangle)
      {
      xangle = 0;
      yangle = 0;
      zangle = 0;
      tangle = 180;
      }
      }
      @Finalize
      {
      DeleteGraphic(carriage);
      DeleteGraphic(turret);
      }
      }


      4楼2013-03-18 19:44
      回复
        #TouhouDanmakufu[Stage]
        #Title[Drawing3D_2]
        #Text[Drawing3D Test 2]
        #PlayLevel[Easy]
        #Player[FREE]
        #ScriptVersion[2]
        script_stage_main
        {
        let xangle = 0;
        let tangle = 180;
        let distance = 0;
        let flag = 0;
        let carriage = GetCurrentScriptDirectory~"\img\carriage.png";
        let turret = GetCurrentScriptDirectory~"\img\turret.png";
        @Initialize
        {
        LoadGraphic(carriage);
        LoadGraphic(turret);
        }
        @MainLoop
        {
        }
        @BackGround
        {
        SetViewFrom(500+distance, 90+xangle, -45);
        WriteZBuffer(true);
        UseZBuffer(true);
        SetFog(660, 860, 192, 192, 192);
        SetTexture(carriage);
        SetGraphicRect(0, 0, 32, 32);
        SetAlpha(255);
        SetGraphicAngle(0, 0, 0);
        SetGraphicScale(2, 2);
        DrawGraphic3D(0, 0, -32);
        DrawGraphic3D(0, 0, 32);
        SetGraphicAngle(90, 0, 0);
        DrawGraphic3D(0, +32, 0);
        DrawGraphic3D(0, -32, 0);
        SetGraphicAngle(0, 90, 0);
        DrawGraphic3D(32, 0, 0);
        DrawGraphic3D(-32, 0, 0);
        SetTexture(turret);
        SetGraphicRect(0, 0, 34, 34);
        SetAlpha(255);
        SetGraphicAngle(0, 0, tangle);
        SetGraphicScale(2, 2);
        DrawGraphic3D(0, 0, -35);
        DrawGraphic3D(0, 0, 35);
        SetGraphicAngle(90, 0, tangle);
        DrawGraphic3D(0, 35, 0);
        DrawGraphic3D(0, 0-35, 0);
        SetGraphicAngle(0, 90, tangle);
        DrawGraphic3D(35, 0, 0);
        DrawGraphic3D(-35, 0, 0);
        xangle += 0.75;
        tangle += 3;
        if(360 == xangle)
        {
        xangle = 0;
        tangle = 180;
        }
        if(0 == flag)
        {
        distance += 2;
        if(distance >= 360)
        {
        flag = 1;
        }
        }
        else
        {
        distance -= 2;
        if(distance <= 0)
        {
        flag = 0;
        }
        }
        }
        @Finalize
        {
        DeleteGraphic(carriage);
        DeleteGraphic(turret);
        }
        }


        5楼2013-03-18 19:47
        回复
          pan.baidu.c防om/share/link?shareid=375638&uk=4094677229
          bmp 格式的图片只能一片漆黑着用,改用 png 格式解决,事实上一般也全用 png


          6楼2013-03-18 19:48
          回复
            目前已知问题,弹幕风在绘制图像的时候会自动对图像做柔化处理以使图像看上去更平滑,
            但一旦调用过一次 DrawText 函数,在其之后绘制的所有图像都会变成像素清晰的原图,,
            是否可以设置未知


            7楼2013-03-18 20:15
            回复
              求问,弹幕风制作好的程序文本文档应该放那个文件夹啊!


              IP属地:北京来自Android客户端8楼2014-10-13 08:23
              收起回复