Jump to content
3LGStevo

UI Flicker when updating display element

Recommended Posts

I've recently created a new HUD overlay for my altis life server, on the UI, there is a picture that displays an icon of a mail item and when the user receives a new message, the icon changes to a picture alerting them that they have a new message.

When this changeover occurs, my whole UI overlay flickers off and then back on again. This only appears to do it for this icon, and one other icon when they're being changed. The rsc display is not removed at any point while these icons are updated in the code, but for the first swap-over, the flicker occurs. After the first swap-over, the interface seems happy enough to swap them over without flashing/flickering.

 

There's not much point in me posting the code here as A: it's far too long, and B: I've been over it several times.

The issue isn't consistent from a repeatable point of view... but is, since it only seems to occur on the first change over of each icon.

 

What I need to know is;

1. Are there any known issues with amending RSC layer pictures that could cause this?

2. Should all files associated with the Rsc Layer be preprocessed?

 

What I've already tried;

1. Loading both images required before the interface is fully utilised - doesn't fix the problem

2. Amended the images manually through debug console - still flashes the UI for the first change over, then continues as expected

3. Removing the UI and re-creating the UI once the images have been swapped over - the next swap-over doesn't flicker.

4. All RscText values on the HUD can be changed / amended with no flickering... the issue solely happens with amending RscPicture's text.

 

Share this post


Link to post
Share on other sites
Quote

 

since it only seems to occur on the first change over of each icon.

 

 

Are you using a HDD? Because it sounds like a delay caused by slow storage.

 

If I remember correctly, images for GUIs are cached in the memory which would explain that it only flickers when opening it for the first time.

Share this post


Link to post
Share on other sites

What R3vo said about the images being cached is correct. If you want to prevent the stutter, simply have a script display every image to cache it.

Share this post


Link to post
Share on other sites
On 1/11/2017 at 6:14 PM, R3vo said:

 

Are you using a HDD? Because it sounds like a delay caused by slow storage.

 

If I remember correctly, images for GUIs are cached in the memory which would explain that it only flickers when opening it for the first time.

 

Nope, SSD.

 

On 1/11/2017 at 6:34 PM, MrCopyright said:

What R3vo said about the images being cached is correct. If you want to prevent the stutter, simply have a script display every image to cache it.

 

Already tried that.

 

On 1/11/2017 at 6:50 PM, killzone_kid said:

 

I'll give this a shot... thanks.

Share this post


Link to post
Share on other sites
On 1/11/2017 at 6:50 PM, killzone_kid said:

 

I've tried to use this, and I get an error message on connecting "Resource not found"...

 

 

in my init.sqf file:


_ok = preloadTitleRsc ["playerHUD","PLAIN"];

 

my ui.hpp file:

class playerHUD
{
    idd=23500;
    movingEnable=0;
    fadein=0;
    duration = 99999999999999999999999999999999999999999999;
    fadeout=0;
    name="playerHUD";
    onLoad="uiNamespace setVariable ['playerHUD',_this select 0]";
    objects[]={};
    
    class controlsBackground 


etc...

called in description.ext:

 


class RscTitles
{
	#include "dialog\ui.hpp"
	#include "dialog\progress.hpp"
	#include "dialog\hud_nameTags.h"
	#include "dialog\promotion.hpp"
	#include "dialog\capture.hpp"
	#include "dialog\timers.hpp"
	#include "dialog\scoreboard.hpp"
	#include "dialog\gk_HUD_display.hpp"
};

 

Share this post


Link to post
Share on other sites

If you can display it with cutRsc then you should be able preload it with preloadTitleRsc. I never had problem with it, and had no errors.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×