mugenboss吧 关注:410贴子:3,477
  • 11回复贴,共1

给做整合同学的教程-全屏特效自适应分辨率的写法

只看楼主收藏回复

最近玩到个LEGACY整合不错,考虑整理一个,有同好否?
目前涉及到的全屏背景,SC,DC,02UM等皆可用以下方法改为自适应,一次写完终生不用改!
本方法当人物localcoord = 320
在320:240,640:480,640,360,720:405,720:540,1280:720中测试通过


IP属地:江苏1楼2018-12-04 12:23回复
    [Statedef 40001];02UM大背景
    anim = 9999
    。。。
    [State 40001, Tile #1-7]
    type = Explod
    triggerall = !numexplod(15600)
    trigger1 = !time
    anim = ifelse((root,var(58) = 0),15600,15610)
    ID = 15600
    pos = 0,0
    postype = left ;p2,front,back,left,right
    removetime = 10
    pausemovetime = -1
    supermovetime = -1
    scale = 1,(4*gameheight) / (gamewidth*3)
    ;此处普屏 4:3时 scale为1:1
    ; 宽屏 16:9时 scale需调整为1:.75
    ;当人物localcoord = 320,180(或240也可)时
    ;由于mugen可读取mugen.cfg中gameheight,gamewidth数据(不写默认240:320)
    ;代入后比例即为自适应
    sprpriority = -20
    ownpal = 1
    ignorehitpause = 1
    bindtime = -1
    persistent = 0


    IP属地:江苏2楼2018-12-04 12:23
    回复
      ;坐标pos和大小scale都应按比例补正
      [State 40001, P2 BG];如红蓝长条
      type = Explod
      triggerall = !numexplod(15651)
      ;triggerall = palno = [1,6]
      triggerall = teamside = 2
      trigger1 = !time
      anim = 10010
      ID = 15651
      pos = 0,abs((240*var(0))-81)*(4*gameheight) / (gamewidth*3)
      postype = right ;p2,front,back,left,right
      pausemovetime = -1
      supermovetime = -1
      removetime = -2
      bindtime = -1
      scale = 1,(4*gameheight) / (gamewidth*3) ;0.75
      facing = -1
      sprpriority = -20
      ownpal = 1
      ignorehitpause = 1
      [State 40001, P1 PORTRAIT];UM头像
      type = Explod
      triggerall = !numexplod(15660)
      triggerall = teamside = 1
      trigger1 = !time
      anim = ifelse((root,var(58) = 0),10015,10025)
      ID = 15660
      pos = 0,abs((240*var(0))-81)*(4*gameheight) / (gamewidth*3)
      postype = left ;p2,front,back,left,right
      pausemovetime = -1
      supermovetime = -1
      removetime = -2
      bindtime = -1
      scale = 1,(4*gameheight) / (gamewidth*3) ;0.75
      sprpriority = -19
      ownpal = 1
      ignorehitpause = 1
      [State 40003, ModifyExplod];变化中也应补正
      type = ModifyExplod
      trigger1 = time = 2
      ID = 15650
      scale = 1,0.3*(4*gameheight) / (gamewidth*3) ;0.225


      IP属地:江苏3楼2018-12-04 12:24
      回复
        若当人物localcoord = 400时,所有全屏背景或技能都需按比例增大,比例为*400/320,如要自适应,必须想办法在cns中读取localcoord的数值


        IP属地:江苏4楼2018-12-04 12:25
        回复
          PS:三神器疯麻子的mugen legacy全适配通用火花版和mugen match记分系统通用火花版已改好,年前放出


          IP属地:江苏5楼2018-12-04 12:37
          回复
            以上内容版权所有,转载注明本人为作者,谢谢


            IP属地:江苏7楼2018-12-04 13:13
            回复
              通用stage的改法最简单的是:16:9向4:3切换时只需调整zoomin、out比例即可,再不行就放大背景的yscale。


              IP属地:江苏8楼2018-12-05 16:08
              回复
                实测1.1b及之前版本,stage.def中zoomin、out及各scale读取gameheight / gamewidth失败(即无效,stage下该代码不可用)


                IP属地:江苏9楼2018-12-05 16:11
                回复
                  你回坑了吗??那个我用下你的人物素材方便能留个联系方式吗,如果可以的话。


                  来自Android客户端11楼2018-12-18 12:14
                  收起回复
                    这个代码粘在哪里啊


                    IP属地:山东来自Android客户端12楼2021-10-07 08:47
                    回复