This article's documentation is for anything that uses the Source engine. Click here for more information.

Vgui slideshow display: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Robot: fixing template case.)
m (→‎Inputs: Substituted IO templates)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{wrongtitle|title=vgui_slideshow_display}}
{{CD|CSlideshowDisplay|file1=slideshow_display.cpp}}
{{base_point}}[[Category:GUI Entities]][[Category:VGUI|S]]
{{this is a|point entity|name=vgui_slideshow_display}} It is a [[Vgui|VGUI]] screen that displays images in a slideshow.
 
==Entity Description==
A [[Vgui|VGUI]] screen the displays images in a slideshow.
* See also [[VGUI Screen]]


==Creation Notes==
==Creation Notes==
Line 19: Line 15:




==Key values==
== Keyvalues ==
 
{{KV Targetname}}
*{{KV Targetname}}
{{KV|Display Text|intn=displaytext|string|Text to display on top of the image. }}
*{{KV Parentname}}
{{KV|Image Directory (materials/vgui/...)|intn=directory|string|Directory where images are located (materials/vgui/[directory]).}}
*{{KV Angles}}
{{KV|Min Slide Time|intn=minslidetime|float|Minimum amount of random time that a slide is displayed.}}
{{KV|Max Slide Time|intn=maxslidetime|float|Maximum amount of random time that a slide is displayed.}}
{{KV|Cycle Type|intn=cycletype|choices|Order that images are displayed.}}
:* 0 : Random
:* 1 : Forward
:* 2 : Backward
{{KV|No List Repeat|intn=nolistrepeat|choices}}
:* 0 : Allow List Repeats
:* 1 : No List Repeats
{{KV|Panel width|intn=width|integer|Width of the panel in units.}}
{{KV|Panel height|intn=height|integer|Height of the panel in units.}}


*'''displaytext''' <string>
== Inputs ==
:Text to display on top of the image.
{{I|Enable|Make slideshow visible.}}
*'''directory''' <string>
{{I|Disable|Make slideshow invisible.}}
:Directory where images are located (materials/vgui/[directory]).
{{I|SetDisplayText|Sets the display text.|param=string}}
*'''minslidetime''' <string>
{{I|RemoveAllSlides|Removes all slides from slideshow.}}
:Minimum amount of random time that a slide is displayed.
{{I|AddSlides|Adds slides by keyword.|param=string}}
*'''maxslidetime''' <string>
{{I|SetMinSlideTime|Sets min random time between slides.|param=float}}
:Maximum amount of random time that a slide is displayed.
{{I|SetMaxSlideTime|Sets max random time between slides.|param=float}}
*'''cycletype''' <choices>
{{I|SetCycleType|0 - random, 1 - forward, 2 - backward|param=integer}}
:Order that images are displayed (0 - random, 1 - forward, 2 - backward).
{{I|SetNoListRepeat|Sets if lists can be randomly picked twice in a row.|param=boolean}}
*'''width''' <integer>
:Width of the panel in units.
*'''height''' <integer>
:Height of the panel in units.


==Inputs==
== See also ==
*{{I Targetname}}
* {{ent|vgui_screen}}
*{{I Parentname}}
* {{ent|func_monitor}}
*'''Enable'''
* {{ent|VGUI Screen}}
:Make the vgui screen visible.
*'''Disable'''
:Make the vgui screen invisible.
*'''SetDisplayText <string>'''
:Sets the text displayed over the image.
*'''RemoveAllSlides'''
:Removes all slides from slideshow.
*'''AddSlides <string>'''
:Add all slides that contain this keyword. If no keyword parameter is provided, ALL the slides are added.
*'''SetMinSlideTime'''
:Sets the minimum random time between slides.
*'''SetMaxSlideTime'''
:Sets the maximimum random time between slides.
*'''SetCycleType'''
:Sets the order that images are displayed (0 - random, 1 - forward, 2 - backward).
*'''SetNoListRepeat'''
:When set, the random list choser will never choose the same list twice in a row.


==Outputs==
[[Category:GUI Entities]]
{{O Targetname}}
[[Category:VGUI|S]]

Latest revision as of 11:26, 21 April 2025

C++ Class hierarchy
CSlideshowDisplay
CBaseEntity
C++ slideshow_display.cpp

vgui_slideshow_display is a point entity available in all Source Source games. It is a VGUI screen that displays images in a slideshow.

Creation Notes

  • Place it in the lower left corner of where you want the screen and rotate it so that the red axis points which way you want the screen to face.
  • You'll need to move it slightly away from the surface it sits on to avoid Z-fighting. 1 unit is enough.
  • Images in sub directories will NOT be included.

Adding Slides to Slideshow

  • Keywords are added in the vmt like so: "%keywords" "test1, test2, another_sample_keyword, cow, animal"
  • AddSlides can be used up to 16 times in succession to add addition slides. So you can add "cow" slides and then add "chicken" slides if you want both cows and chickens to be in the shuffle.
  • Slides are first shuffled by keyword. So if you have 400 "cow" slides and 10 "chicken" slides there's still a 1 out of 2 chance that you'll see a chicken. Then if "chicken" is selected for display there's a 1 out of 10 chance that you'll see any specific chicken.
  • The same keyword can be added multiple times to weight which slides are more common. So you could add "cow", "cow", "cow", "chicken" and you'll be 3 times more likely to see a cow in the shuffle than a chicken.
  • Setting the cycle type to forward will display all the added images in order by keyword (in the order that the keywords were added), then in alphabetical order for each slide in the keyword.


Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Display Text (displaytext) <string>
Text to display on top of the image.
Image Directory (materials/vgui/...) (directory) <string>
Directory where images are located (materials/vgui/[directory]).
Min Slide Time (minslidetime) <float>
Minimum amount of random time that a slide is displayed.
Max Slide Time (maxslidetime) <float>
Maximum amount of random time that a slide is displayed.
Cycle Type (cycletype) <choices>
Order that images are displayed.
  • 0 : Random
  • 1 : Forward
  • 2 : Backward
No List Repeat (nolistrepeat) <choices>
  • 0 : Allow List Repeats
  • 1 : No List Repeats
Panel width (width) <integer>
Width of the panel in units.
Panel height (height) <integer>
Height of the panel in units.

Inputs

Enable
Make slideshow visible.
Disable
Make slideshow invisible.
SetDisplayText <stringRedirectInput/string>
Sets the display text.
RemoveAllSlides
Removes all slides from slideshow.
AddSlides <stringRedirectInput/string>
Adds slides by keyword.
SetMinSlideTime <floatRedirectInput/float>
Sets min random time between slides.
SetMaxSlideTime <floatRedirectInput/float>
Sets max random time between slides.
SetCycleType <integerRedirectInput/integer>
0 - random, 1 - forward, 2 - backward
SetNoListRepeat <booleanRedirectInput/boolean>
Sets if lists can be randomly picked twice in a row.

See also