altv-issues icon indicating copy to clipboard operation
altv-issues copied to clipboard

Blip.color doesn't work when setting before blip.sprite

Open TheDutchDev opened this issue 3 years ago • 2 comments

Description of the problem

When creating an alt.PointBlip client-side and setting the color property BEFORE setting the sprite property, the color will always be white.

Minor issue, but can still be very confusing as there are no warnings/errors given when doing this.

Reproduction steps

This one won't work

    missionBlip = new alt.PointBlip( x, y, z );
    missionBlip.color = 64; // gold color
    missionBlip.sprite = 1;

This one will work:

    missionBlip = new alt.PointBlip( x, y, z );
    missionBlip.sprite = 1;
    missionBlip.color = 64; // gold color

Expected behaviour

Color should work even when setting it before sprite.

Additional context

Since sprite can be set at any given time, the simplest solution might just be to re-apply the color after sprite has changed.

Operating system

Windows 10

Version

Release 12.10

TheDutchDev avatar Aug 17 '22 09:08 TheDutchDev

This is just how GTA works so I am unsure if we want to fix this

LeonMrBonnie avatar Aug 17 '22 09:08 LeonMrBonnie

I think we can workaround it in client code in the future.

FabianTerhorst avatar Aug 17 '22 11:08 FabianTerhorst

@QuiGonJinnAndTonic Could you test in newest dev?

C0kkie avatar Jul 05 '23 20:07 C0kkie