Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

question on refresh / update

wlzza

Sponsor

Hi there, well just a simple question really. I want to know what's the difference between 'refresh' and 'update' if any. I kinda have a rough understanding of how refresh works but thinks update functions like refresh.
 
Um... not quite :p

update is what's happening every frame, aka 60 times per second. You don't want to put text draw commands or anything like it into this, unless you know what you're doing, as anything processing-intensive will hugely slow your game down when done every frame.

refresh executes a defined set of commands, like drawing text, on request. For example, at most of the default windows, you'll see a refresh call at the end of initialize - that effectively draws the windows contents for the first time. Now, you can also call the refresh method when the window is already there, for example after your heroes took damage in battle: refresh your window, and you'll see their new health values.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top