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
mNo edit summary
m (→‎Inputs: Substituted IO templates)
 
(12 intermediate revisions by 6 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.


==Creation Notes==
==Creation Notes==
Line 17: Line 14:
* 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.
* 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.


==Key values==
*{{kv targetname}}
*{{kv parentname}}
*{{kv angles}}


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


==Inputs==
== Inputs ==
*{{i targetname}}
{{I|Enable|Make slideshow visible.}}
*{{i parentname}}
{{I|Disable|Make slideshow invisible.}}
*'''Enable'''
{{I|SetDisplayText|Sets the display text.|param=string}}
:Make the vgui screen visible.
{{I|RemoveAllSlides|Removes all slides from slideshow.}}
*'''Disable'''
{{I|AddSlides|Adds slides by keyword.|param=string}}
:Make the vgui screen invisible.
{{I|SetMinSlideTime|Sets min random time between slides.|param=float}}
*'''SetDisplayText <string>'''
{{I|SetMaxSlideTime|Sets max random time between slides.|param=float}}
:Sets the text displayed over the image.
{{I|SetCycleType|0 - random, 1 - forward, 2 - backward|param=integer}}
*'''RemoveAllSlides'''
{{I|SetNoListRepeat|Sets if lists can be randomly picked twice in a row.|param=boolean}}
: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==
== See also ==
{{o targetname}}
* {{ent|vgui_screen}}
* {{ent|func_monitor}}
* {{ent|VGUI Screen}}


==See also==
[[Category:GUI Entities]]
* [[VGUI Screen]]
[[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