1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[JASS] 3D Model on UI

Discussion in 'Triggers & Scripts' started by xorkatoss, Nov 27, 2019.

  1. xorkatoss

    xorkatoss

    Joined:
    Jul 12, 2010
    Messages:
    1,527
    Resources:
    7
    Models:
    5
    Maps:
    1
    Spells:
    1
    Resources:
    7
    ok guys so I saw this thread and I tried to make a 3D model on UI with no luck...

    Code (Text):

    local framehandle model = BlzCreateFrameByType("SPRITE", "Test", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)

    //    call BlzFrameSetModel(model, "units\\human\\ArthaswithSword\\ArthaswithSword", 0)
        call BlzFrameSetModel(model, "ui\\feedback\\xpbar\\xpbarconsole.mdx", 0)

    //    call BlzFrameSetTexture(model, "Textures\\Arthas.blp" , 1, true)

    //    call BlzFrameSetSpriteAnimate(model, 1, 0)

        call BlzFrameSetSize(model, 0.2, 0.2)
        call BlzFrameSetAbsPoint(model, FRAMEPOINT_CENTER, 0.4, 0.4)

    endfunction

    //===========================================================================
    function InitTrig_model_3d takes nothing returns nothing
        set gg_trg_model_3d = CreateTrigger(  )
        call TriggerRegisterTimerEventSingle( gg_trg_model_3d, 0.50 )
        call TriggerAddAction( gg_trg_model_3d, function Trig_model_3d_2_Actions )
    endfunction
     

    Does anybody know how to do it without the whole screen turning black?

    Also why does this method require special 2d models? o_O

    If anybody knows please provide a working example, thank you.
     

    Attached Files:

  2. xorkatoss

    xorkatoss

    Joined:
    Jul 12, 2010
    Messages:
    1,527
    Resources:
    7
    Models:
    5
    Maps:
    1
    Spells:
    1
    Resources:
    7
    *bump*

    So I guess it's not possible eh? =/
     
  3. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,358
    Resources:
    17
    Tools:
    2
    Maps:
    2
    Spells:
    8
    Tutorials:
    4
    JASS:
    1
    Resources:
    17
    Unit models are huge, to have them fit on the screen one has to scale them down to a small fraction. In Reforge Beta they are displayed in not black mode.

    Code (Lua):
    TimerStart(CreateTimer(), 0, false, function()
        print("Start")  
        local parent = BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0)
        local spriteFrame = BlzCreateFrameByType("SPRITE", "", parent, "", 0)
        BlzFrameSetModel(spriteFrame, "units\\human\\Footman\\Footman.mdx", 0)
        BlzFrameSetSize(spriteFrame, 0.001, 0.001)
        BlzFrameSetScale(spriteFrame, 0.002)
        BlzFrameSetAbsPoint(spriteFrame, FRAMEPOINT_CENTER, 0.4, 0.3)
        print("Done")
    end)