Log in to reply
 

Some questions



  • I have some questions:
    I'm using .NET

    1. How i can draw text above draw texture. Currently i'm using:
      UI.DrawTexture(Application.StartupPath + "/scripts/test.png", 0, 0, 999, new Point(10, 10), new Size(100, 100));
      But text is under texture and this function render texture for a time.

    2. If upper question is not to solve, how i can create custom sprite and when i must put created files :)

    3. On this screen is used texture or sprite ? if it's sprite then what is it "name".
      https://img.gta5-mods.com/q95/images/georgezhang-s-gang-war-net/3be067-passed.jpg
      (Propagates me about this background gradient)

    And the last question is.
    4.How i can catch directx graphic event in ScrptHookVDotNet.

    Edit.
    5.And how i can create text label on the world like this
    https://img.gta5-mods.com/q95/images/georgezhang-s-gang-war-net/3be067-creator0.jpg

    Thanks very mush for help



  • @Reveres Based on my own tests, all I can offer is

    1. You can't. UI.DrawTexture() seems to draw to the top level.

    2. You can create custom sprites in the same place you have your test.png and the order you draw textures in, dictates which gets drawn first/last. There is supposed to be a way to draw custom sprites from a texture dictionary but I couldn't get it to work.

    3. Not sure but it could be one of the Scaleform movies... or it could be a custom sprite with a font as individual letter sprites.

    4. I don't think you can.

    5. I have a way to do that but it only allows you to create one instance of it at a time, so I don't think it's the right way to do it. I'll post the code anyway, just in case it's enough for what you need.

    // add this to your variable declarations
        Scaleform InfoDisplay;
        InfoDisplay = new Scaleform("PLAYER_NAME_01");// <--- Ignore the text here, this is required by the game and must be written as it is shown.
        string DisplayText = "This is some text";
    
    // Generate a position for the display. If you wanted it on a Ped, you could use this and it will be displayed roughly just above the Ped's head MyPed.GetOffsetInWorldCoords(new Vector3(0, 0, 1));
        Vector3 InfoPosition = Game.Player.Character.GetOffsetInWorldCoords(new Vector3(0, 5, 1));
    // You have to provide an X, Y and Z scale but think bigger than you would for normal text
        Vector3 InfoScale = new Vector3(10, 5, 1);
    
        // Call this next section in your onTick()
    
    // Makes it always face the camera
        float InfoRotation = 0 - GameplayCamera.Rotation.Z;
        InfoDisplay.CallFunction("SET_PLAYER_NAME", DisplayText);// <--- Ignore the text in RED here, this is also required by the game and must be as written
        InfoDisplay.Render3D(InfoPosition, new Vector3(0, InfoRotation, 0), InfoScale);
    


  • @LeeC2202
    Ok thanks, but.
    I created rpf file "resources.rpf" with ytd texture"res.ytd" with test texture "test", and i placed it in scripts folder in script i created UI.DrawSprite like that:
    new UISprite("res", "test", new Size(100, 100), new Point(100, 100));
    And in GTA i dont see this sprite :/

    @@OK EDIT
    i solved it.
    I installed openIV.asi, i created ytd file in /mods/update/update.rpf/x64/textures/scripts_txds.rpf

    My other question is, how i can write plugin like openIV.asi (i dont find soruces :/) to load custom rpf file while game is running ?



  • @Reveres Can I just confirm how you solved the custom sprite problem please?

    Did you create the res.ytd inside /mods/update/update.rpf/x64/textures/scripts_txds.rpf and then create a test.dds inside that and then draw it with the line you wrote above?

    It's hard to work out which bit worked with so much having the line through it.

    To write any asi based mods, you would need to write them in C++ instead of .Net.

    As for loading custom rpf files, I honestly don't know about that, I have never written any mods in C++.



  • @LeeC2202 OK see on screens:
    Run openIV software to edit file
    /mods/update/update.rpf/x64/textures/scripts_txds.rpf
    alt text
    Then Right click>New>Texture dictionary (I named it customTexture).
    alt text
    Open customTexture.ytd.
    Click Import button(1).
    In new window select your texture (.png/.jpg) (2) and click Open (3).
    Dont forget click Save (4).
    alt text
    Done.

    To draw sprite:
    UISprite sprite = new UISprite("customTexture", "textureName(without extension)", new Size(100, 100), new Point(100, 100));
    //in Tick
    sprite.Draw();

    I think that helped.



  • @Reveres Thank you, that will be really useful.



  • Tomorrow publish it in tutorial forum if i can



  • @Reveres If we can ever work out a way of getting this to work in the dlcpacks folder as an addon textures file, it would be great.


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.