DayZ 1.24
Loading...
Searching...
No Matches
EnWidgets.c
Go to the documentation of this file.
6#ifdef DOXYGEN
11
13 TextWidgetTypeID,
15 MultilineTextWidgetTypeID,
17 MultilineEditBoxWidgetTypeID,
19 RichTextWidgetTypeID,
21 RenderTargetWidgetTypeID,
23 ImageWidgetTypeID,
25 ConsoleWidgetTypeID,
27 VideoWidgetTypeID,
29 RTTextureWidgetTypeID,
31 FrameWidgetTypeID,
33 EmbededWidgetTypeID,
34 ButtonWidgetTypeID,
35 CheckBoxWidgetTypeID,
36 WindowWidgetTypeID,
37 ComboBoxWidgetTypeID,
38 SimpleProgressBarWidgetTypeID,
39 ProgressBarWidgetTypeID,
40 SliderWidgetTypeID,
41 BaseListboxWidgetTypeID,
42 TextListboxWidgetTypeID,
43 GenericListboxWidgetTypeID,
44 EditBoxWidgetTypeID,
45 PasswordEditBoxWidgetTypeID,
46 WorkspaceWidgetTypeID,
47 GridSpacerWidgetTypeID,
48 WrapSpacerWidgetTypeID,
49 ScrollWidgetTypeID,
51#else
53#endif
54
56
58{
59 SOURCEALPHA, //< takes alpha from texture * alpha from color. If not set, considers texture as non-transparent and transparency is set only by color
60 BLEND, //< texture is blended with a surface base on alpha
61 ADDITIVE, //< texture is added to a surface based on alpha
62 VISIBLE, //<Widget is visible - ShowWidget(w, true)
63 NOWRAP, //< Do not do texture wrapping
64 CENTER, //< Centers TextWidgetTypeID
65 VCENTER, //< Centers TextWidgetTypeID verticaly
68 EXACTPOS, //< Uses physical resolution (g_iWidth, h_iHeight)
69 HEXACTSIZE, //< Uses physical resolution (g_iWidth)
70 VEXACTSIZE, //< Uses physical resolution (h_iHeight)
71 EXACTSIZE, //< Uses physical resolution
72 NOFILTER, //< no texture filtering (no blur)
73 RALIGN, //< Right alignment TextWidgetTypeID
74 STRETCH, //< Stretch texture to a full size
75 FLIPU, //< Flips texture in U axis
76 FLIPV, //< Flips texture in V axis
77 CUSTOMUV, //< ignores STRETCH/FLIPU/FLIPV and take custom UV set by SetWidgetUV()
85};
86
87//------------------------------------------
89{
90 WA_LEFT = 0,
91 WA_RIGHT = 1,
92 WA_CENTER = 2,
93 WA_TOP = 0,
94 WA_BOTTOM = 1,
95}
96
97//------------------------------------------
99/*enum LinebreakOverrideMode
100 {
101 LINEBREAK_DEFAULT,
102 LINEBREAK_WESTERN,
103 LINEBREAK_ASIAN
104 };*/
105
106//------------------------------------------
107class Widget: Managed
108{
109 proto void ~Widget();
110 proto private void Widget();
111
112 proto static string TranslateString(string stringId);
113
115 proto static void SetLV(float lv);
117 proto static void SetTextLV(float lv);
119 proto static void SetObjectLighting(float lighting);
120
121 proto native owned string GetName();
122 proto native void SetName(string name);
123 proto native owned string GetTypeName();
124 proto native WidgetType GetTypeID();
125 proto native void Show(bool show, bool immedUpdate = true);
126 proto native void Enable(bool enable);
127 proto native int GetFlags();
128 proto native int SetFlags(int flags, bool immedUpdate = true);
129 proto native int GetSort();
130 proto native void SetSort(int sort, bool immedUpdate = true);
131 proto native int ClearFlags(int flags, bool immedUpdate = true);
132 proto native bool IsControlClass();
133 proto native owned string GetStyleName();
134 proto void GetUserData(out Class data);
135 proto native void SetUserData(Class data);
136 proto native int GetUserID();
137 proto native void SetUserID(int id);
138 proto native bool IsVisible();
139 proto native bool IsVisibleHierarchy();
140 proto native void SetPos(float x, float y, bool immedUpdate = true);
141 proto native void SetSize(float w, float h, bool immedUpdate = true);
142 proto native void SetScreenPos(float x, float y, bool immedUpdate = true);
143 proto native void SetScreenSize(float w, float h, bool immedUpdate = true);
144 proto native void SetColor(int color);
145 proto native int GetColor();
146 proto native void SetRotation(float roll, float pitch, float yaw, bool immedUpdate = true);
148 proto native vector GetRotation();
149 proto native void SetAlpha(float alpha);
150 proto native float GetAlpha();
151 proto void GetPos(out float x, out float y);
152 proto void GetSize(out float width, out float height);
153 proto void GetScreenPos(out float x, out float y);
154 proto void GetScreenSize(out float width, out float height);
155
156 proto native void SetTransform(vector mat[4], bool immedUpdate = true);
157
158 proto native Widget GetParent();
159 proto native Widget GetChildren();
160 proto native Widget GetSibling();
161 proto native void AddChild(Widget child, bool immedUpdate = true);
162 proto native void RemoveChild(Widget child);
163
164 proto native volatile void Update();
165
166 proto void GetScript(out Class data);
167
168 proto native Widget FindWidget(string pathname); //find Widget by path. e.g FindWidget("widget1.widget2.widget3.mywidget")
169 proto native Widget FindAnyWidget(string pathname); //find Widget by name e.g. FindWidget("widget1")
170 proto native Widget FindAnyWidgetById(int user_id); //find Widget by userID
171
172 proto native void SetHandler(ScriptedWidgetEventHandler eventHandler);
173 proto native void Unlink(); //destroys widget and all its children
174};
175
177{
179 proto native external Widget CreateWidget(WidgetType type, int left, int top, int width, int height, WidgetFlags flags, int color, int sort, Widget parentWidget = NULL);
181 proto native external Widget CreateWidgets(string layout, Widget parentWidget = NULL, bool immedUpdate = true);
183
186proto native Widget GetDragWidget();
187proto native void ReportMouse(int mousex, int mousey, Widget rootWidget);
188
189class TextWidget extends Widget
190{
191 proto native void SetTextSpacing(int horiz, int vert);
193 proto native void SetTextExactSize(int size);
194 proto native void SetTextOffset(int left, int top);
195 proto native void SetText(string text, bool immedUpdate = true);
196 proto native void SetOutline(int outlineSize, int argb = 0xFF000000);
197 proto native int GetOutlineSize();
198 proto native int GetOutlineColor();
199 proto native void SetShadow(int shadowSize, int shadowARGB = 0xFF000000, float shadowOpacity = 1, float shadowOffsetX = 0, float shadowOffsetY = 0);
200 proto native int GetShadowSize();
201 proto native int GetShadowColor();
202 proto native float GetShadowOpacity();
203 proto void GetShadowOffset(out float sx, out float sy);
204 proto native void SetItalic(bool italic);
205 proto native bool GetItalic();
206 proto native void SetBold(bool bold);
207 proto native bool GetBold();
208
210 proto void GetTextSize(out int sx, out int sy);
211 proto void SetTextFormat(string text, void param1 = NULL, void param2 = NULL, void param3 = NULL, void param4 = NULL, void param5 = NULL, void param6 = NULL, void param7 = NULL, void param8 = NULL, void param9 = NULL);
212
214 proto native float GetTextProportion();
216 proto native void SetTextProportion(float val);
217};
218
219class MultilineTextWidget extends TextWidget
220{
221 proto native float SetLineBreakingOverride(int mode);
222};
223
224class RichTextWidget extends TextWidget
225{
226 proto native float GetContentHeight();
227 proto native float GetContentOffset();
228 proto native void SetContentOffset(float offset, bool snapToLine = false);
229 proto native void ElideText(int line, float maxWidth, string str);
230 proto native int GetNumLines();
231 proto native void SetLinesVisibility(int lineFrom, int lineTo, bool visible);
232 proto native float GetLineWidth(int line);
233 proto native float SetLineBreakingOverride(int mode);
234};
235
236class RenderTargetWidget extends Widget
237{
239 proto native void SetRefresh(int period, int offset);
240 proto native void SetResolutionScale(float xscale, float ycale);
241};
242
243class RTTextureWidget extends Widget
244{
245};
246
247class ImageWidget extends Widget
248{
257 proto native bool LoadImageFile(int num, string name, bool noCache = false);
258 proto native void SetImageTexture(int image, RTTextureWidget texture);
260 proto void GetImageSize(int image, out int sx, out int sy);
261
267 proto native bool SetImage(int num);
269 proto native int GetImage();
275 proto native void SetUV(float uv[4][2]);
276
282 proto native bool LoadMaskTexture(string resource);
283
290 proto native float GetMaskProgress();
291
296 proto native void SetMaskProgress(float value);
297
304 proto native float GetMaskTransitionWidth();
305
310 proto native void SetMaskTransitionWidth(float value);
311};
312
313class MultilineEditBoxWidget extends TextWidget
314{
315 proto native int GetLinesCount();
316 proto native int GetCarriageLine();
317 proto native int GetCarriagePos();
318 proto void GetText(out string text);
319 proto native void SetLine(int line, string text);
320 proto void GetLine(int line, out string text);
321};
322
323class UIWidget extends Widget
324{
325 proto native void SetTextColor(int color);
326 proto native void SetTextOutline(int outlineSize, int argb = 0xFF000000);
327 proto native int GetTextOutlineSize();
328 proto native int GetTextOutlineColor();
329 proto native void SetTextShadow(int shadowSize, int shadowARGB = 0xFF000000, float shadowOpacity = 1.0, float shadowOffsetX = 0.0, float shadowOffsetY = 0.0);
330 proto native int GetTextShadowSize();
331 proto native int GetTextShadowColor();
332 proto native float GetTextShadowOpacity();
333 proto native float GetTextShadowOffsetX();
334 proto native float GetTextShadowOffsetY();
335 proto native void SetTextItalic(bool italic);
336 proto native bool GetTextItalic();
337 proto native void SetTextBold(bool bold);
338 proto native bool GetTextBold();
339};
340
341class CanvasWidget extends Widget
342{
343 proto native void DrawLine(float x1, float y1, float x2, float y2, float width, int color);
344 proto native void Clear();
345};
346
348{
349 proto string GetText();
350 proto native void SetText(string str);
351};
352
353class PasswordEditBoxWidget extends EditBoxWidget
354{
355 proto native void SetHideText(bool hide);
356};
357
358class SliderWidget extends UIWidget
359{
360 proto native void SetMinMax(float minimum, float maximum);
361 proto native float GetMin();
362 proto native float GetMax();
363 proto native float GetCurrent();
364 proto native void SetCurrent(float curr);
365 proto native float GetStep();
366 proto native void SetStep(float step);
367};
368
370{
371 proto native float GetMin();
372 proto native float GetMax();
373 proto native float GetCurrent();
374 proto native void SetCurrent(float curr);
375};
376
377class ProgressBarWidget extends SimpleProgressBarWidget
378{
379};
380
381class ButtonWidget extends UIWidget
382{
383 proto native bool GetState();
384
385 proto native bool SetState(bool state);
386
387 proto native void SetText(string text);
388
389 proto void GetText(out string text);
390
391 proto native void SetTextOffset(float xoffset, float yoffset);
395 proto native void SetTextHorizontalAlignment(int align);
399 proto native void SetTextVerticalAlignment(int align);
400
402 proto native float GetTextProportion();
404 proto native void SetTextProportion(float val);
405};
406
407class XComboBoxWidget extends UIWidget
408{
409 proto native int AddItem(string item);
410 proto native void ClearAll();
411 proto native void SetItem(int item, string value);
412 proto native void RemoveItem(int item);
413 proto native int GetNumItems();
414 proto native int SetCurrentItem(int n);
415 proto native int GetCurrentItem();
416};
417
418class CheckBoxWidget extends UIWidget
419{
420 proto native void SetText(string str);
421 proto native bool IsChecked();
422 proto native void SetChecked(bool checked);
423};
424
425class BaseListboxWidget extends UIWidget
426{
427 proto native void ClearItems();
428 proto native int GetNumItems();
429 proto native void SelectRow(int row);
430 proto native int GetSelectedRow();
431 proto native void RemoveRow(int row);
432 proto native void EnsureVisible(int row);
433};
434
436{
437};
438
439class TextListboxWidget extends SimpleListboxWidget
440{
442 proto native int AddItem(string text, Class userData, int column, int row = -1);
443 proto native void SetItem(int position, string text, Class userData, int column);
454 proto bool GetItemText(int row, int column, out string text);
455 proto void GetItemData(int row, int column, out Class data);
456
457 proto native void SetItemColor(int row, int column, int color);
458};
459
460class SpacerBaseWidget extends UIWidget
461{
462 proto native void AddChildAfter(Widget child, Widget after, bool immedUpdate = true);
463}
464
465class SpacerWidget extends SpacerBaseWidget
466{
468 proto native void SetContentAlignmentH(WidgetAlignment alignment);
470 proto native void SetContentAlignmentV(WidgetAlignment alignment);
471}
472
473class GridSpacerWidget extends SpacerWidget
474{
475}
476
477class WrapSpacerWidget extends SpacerWidget
478{
479}
480
481class ScrollWidget extends SpacerBaseWidget
482{
483 proto native float GetScrollbarWidth();
484 proto native bool IsScrollbarVisible(); //reflects native C++ side scrollbar state
485
486 proto native float GetContentWidth();
487 proto native float GetContentHeight();
488
489 proto native float GetHScrollPos();
490 proto native float GetHScrollPos01();
491 proto native bool HScrollStep(int steps);
492 proto native void HScrollToPos(float pos);
493 proto native void HScrollToPos01(float pos01);
494 proto native void HScrollToWidget(Widget child);
495
496 proto native float GetVScrollPos();
497 proto native float GetVScrollPos01();
498 proto native bool VScrollStep(int steps);
499 proto native void VScrollToPos(float pos);
500 proto native void VScrollToPos01(float pos01);
501 proto native void VScrollToWidget(Widget child);
502};
503
515
529
541
542class VideoWidget extends Widget
543{
545 proto native bool Load(string name, bool looping = false, int startTime = 0);
547 proto native void Unload();
548
550 proto native bool Play();
552 proto native bool Pause();
554 proto native bool Stop();
555
557 proto native bool SetTime(int time, bool preload);
559 proto native int GetTime();
561 proto native int GetTotalTime();
562
564 proto native void SetLooping(bool looping);
566 proto native bool IsLooping();
567
569 proto native bool IsPlaying();
571 proto native VideoState GetState();
572
579 proto native void DisableSubtitles(bool disable);
581 proto native bool IsSubtitlesDisabled();
582
584 proto void SetCallback(VideoCallback cb, func fn);
585
588 {
589 // Yes, some things here do not do what the name implies
590 // And it returns 0 whether successful or not
591 // But this is what the old functionality looked like
592 // So for true backwards compat, it will be left like this
593 switch (cmd)
594 {
595 case VideoCommand.PLAY:
596 Play();
597 break;
598 case VideoCommand.STOP:
599 Pause();
600 break;
601 case VideoCommand.REWIND:
602 SetTime(0, true);
603 break;
604 case VideoCommand.POSITION:
605 return GetTime();
606 case VideoCommand.REPEAT:
607 SetLooping(true);
608 break;
609 case VideoCommand.ISPLAYING:
610 return IsPlaying();
611 case VideoCommand.KILL:
612 Unload();
613 break;
614 default:
615 return 0;
616 }
617
618 return 0;
619 }
620
622 bool LoadVideo(string name, int soundScene)
623 {
624 return Load(name);
625 }
626};
627
631proto native void SetGUIWidget(IEntity ent, int index, RTTextureWidget w);
632
634{
636 CID_SELECT = 1,//select/use focused
638 CID_LEFT, //navigation
642 CID_MENU, //get to main menu
643 CID_DRAG, //probably needed only for consoles
649
651{
652 bool OnClick(Widget w, int x, int y, int button);
653 bool OnModalResult(Widget w, int x, int y, int code, int result);
654 bool OnDoubleClick(Widget w, int x, int y, int button);
655 bool OnSelect(Widget w, int x, int y);
656 bool OnItemSelected(Widget w, int x, int y, int row, int column, int oldRow, int oldColumn);
657 bool OnFocus(Widget w, int x, int y);
658 bool OnFocusLost(Widget w, int x, int y);
659 bool OnMouseEnter(Widget w, int x, int y);
660 bool OnMouseLeave(Widget w, Widget enterW, int x, int y);
661 bool OnMouseWheel(Widget w, int x, int y, int wheel);
662 bool OnMouseButtonDown(Widget w, int x, int y, int button);
663 bool OnMouseButtonUp(Widget w, int x, int y, int button);
665 bool OnController(Widget w, int control, int value);
666 bool OnKeyDown(Widget w, int x, int y, int key);
667 bool OnKeyUp(Widget w, int x, int y, int key);
668 bool OnKeyPress(Widget w, int x, int y, int key);
669 bool OnChange(Widget w, int x, int y, bool finished);
670 bool OnDrag(Widget w, int x, int y);
671 bool OnDragging(Widget w, int x, int y, Widget reciever);
672 bool OnDraggingOver(Widget w, int x, int y, Widget reciever);
673 bool OnDrop(Widget w, int x, int y, Widget reciever);
674 bool OnDropReceived(Widget w, int x, int y, Widget reciever);
675 bool OnResize(Widget w, int x, int y);
676 bool OnChildAdd(Widget w, Widget child);
679 bool OnEvent(EventType eventType, Widget target, int parameter0, int parameter1);
680};
681
682//Common Widget API
683proto native void SetCursorWidget(Widget cursor);
685proto native void ShowCursorWidget(bool show);
686proto native bool LoadWidgetImageSet(string filename);
687proto native void LoadWidgetStyles(string filename);
688// sets active window (widget which owns some control inputs like buttons, listboxes etc.). Necessary for controlling the focus by keyboard/joypad. In case when setFocus is set to true, it sets focus on a first child Widget, which may receive the focus (is not disabled, set as NoFocus etc.)
689proto native bool SetActiveWindow(Widget w, bool resetFocus);
690
691// sets focus (necessary when using keyboard/joyped) to a particular widget. Widget must have some inputs like button, listbox, checkbox, combobox etc.
692proto native void SetFocus(Widget w);
693
694proto native void SetModal(Widget w);
695
696proto native Widget GetFocus();
697
698//RenderTargetWidgetTypeID
699proto native void SetWidgetWorld(RenderTargetWidget w, IEntity wrldEntity, int camera);
700
701
702#ifdef PS3
706 proto native bool IsCircleToCrossSwapped();
707#endif
708
709proto native bool ReloadTexture(string path);
710
711
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
proto native vector GetPos()
void Show()
Definition DayZGame.c:155
Icon x
Icon y
int GetSize()
Super root of all classes in Enforce script.
Definition EnScript.c:11
TODO doc.
Definition EnScript.c:118
map: item x vector(index, width, height)
Definition EnWidgets.c:651
proto native float SetLineBreakingOverride(int mode)
proto native void SetText(string text)
proto native float GetMax()
proto native float GetCurrent()
proto native void SetCurrent(float curr)
proto native float GetMin()
proto native int GetNumItems()
int[] TypeID
script representation for C++ RTTI types
Definition EnScript.c:127
bool OnChange(Widget w, int x, int y, bool finished)
proto native Widget FindAnyWidgetById(int user_id)
proto native int GetColor()
proto native void VScrollToPos01(float pos01)
proto native void Clear()
VideoCommand
Legacy, do not use.
Definition EnWidgets.c:506
proto native void SetRefresh(int period, int offset)
when period > 1 then every n-th frame will be rendered. Offset is initial counter.
proto native void SetText(string str)
proto native Widget GetSibling()
bool OnDrag(Widget w, int x, int y)
bool OnMouseButtonUp(Widget w, int x, int y, int button)
bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
proto native void SetAlpha(float alpha)
proto bool GetItemText(int row, int column, out string text)
Get item.
proto native owned string GetTypeName()
ControlID
Definition EnWidgets.c:634
static proto void SetObjectLighting(float lighting)
Set global lighting of objects in widgets, value between [0, 1], default: 1, lower value is less brig...
proto native int GetCurrentItem()
proto native void SelectRow(int row)
proto native void SetShadow(int shadowSize, int shadowARGB=0xFF000000, float shadowOpacity=1, float shadowOffsetX=0, float shadowOffsetY=0)
VideoState
Definition EnWidgets.c:517
proto native int GetLinesCount()
proto void GetItemData(int row, int column, out Class data)
proto native void DisableSubtitles(bool disable)
Enable/Disable subtitles.
proto native void SetWidgetWorld(RenderTargetWidget w, IEntity wrldEntity, int camera)
bool OnMouseWheel(Widget w, int x, int y, int wheel)
bool OnSelect(Widget w, int x, int y)
proto native bool GetState()
proto native void SetTextProportion(float val)
Set text proportion - ratio between button height and button text height in interval <0,...
proto native Widget GetParent()
Get parent of the Effect.
Definition Effect.c:389
proto native float GetMax()
proto native void SetContentAlignmentH(WidgetAlignment alignment)
proto native float GetTextShadowOffsetX()
proto native bool IsScrollbarVisible()
proto native void VScrollToWidget(Widget child)
WidgetFlags
Definition EnWidgets.c:58
proto native float GetMaskProgress()
proto native int GetNumLines()
proto native void SetItem(int position, string text, Class userData, int column)
proto native bool LoadMaskTexture(string resource)
proto native bool IsPlaying()
QoL direct method to check for playing state (buffering while playing will still return true)
proto native void SetTextShadow(int shadowSize, int shadowARGB=0xFF000000, float shadowOpacity=1.0, float shadowOffsetX=0.0, float shadowOffsetY=0.0)
proto native int GetTextOutlineColor()
proto native external Widget CreateWidgets(string layout, Widget parentWidget=NULL, bool immedUpdate=true)
Create widgets from *.layout file.
proto native Widget GetFocus()
proto void GetScreenSize(out float width, out float height)
proto native bool GetTextItalic()
bool OnMouseEnter(Widget w, int x, int y)
bool OnDrop(Widget w, int x, int y, Widget reciever)
proto native void SetName(string name)
proto native float GetContentWidth()
proto native void SetSize(float w, float h, bool immedUpdate=true)
proto native void SetOutline(int outlineSize, int argb=0xFF000000)
proto native float GetVScrollPos()
proto native void ReportMouse(int mousex, int mousey, Widget rootWidget)
proto native int GetCarriageLine()
proto native void SetLinesVisibility(int lineFrom, int lineTo, bool visible)
proto void GetShadowOffset(out float sx, out float sy)
proto native void SetFocus(Widget w)
proto native void SetTextProportion(float val)
Set text proportion - ratio between button height and button text height in interval <0,...
VideoCallback
Definition EnWidgets.c:531
proto native void SetPos(float x, float y, bool immedUpdate=true)
proto native void AddChild(Widget child, bool immedUpdate=true)
proto native void SetTextOutline(int outlineSize, int argb=0xFF000000)
proto native int GetTime()
Get the current time of the video.
proto native int GetOutlineSize()
bool OnChildAdd(Widget w, Widget child)
proto native void RemoveItem(int item)
proto native void Unlink()
TypeID WidgetType
Definition EnWidgets.c:52
proto native VideoState GetState()
Get the current state of the video.
proto native bool Stop()
Stop video playback (cancels everything and sets it back at time 0)
proto void GetImageSize(int image, out int sx, out int sy)
returns size of image
proto native void SetChecked(bool checked)
proto native void SetTextVerticalAlignment(int align)
proto native float GetCurrent()
proto void GetLine(int line, out string text)
proto native float GetVScrollPos01()
proto native int GetShadowColor()
proto void SetTextFormat(string text, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
proto native void SetTextColor(int color)
proto native Widget FindAnyWidget(string pathname)
proto native void SetLine(int line, string text)
proto native void EnsureVisible(int row)
proto native int GetOutlineColor()
class SpacerBaseWidget extends UIWidget GetContentAlignmentH()
WA_BOTTOM
Definition EnWidgets.c:4
proto native bool Play()
Starts video playback.
bool OnMouseButtonDown(Widget w, int x, int y, int button)
proto native void SetHandler(ScriptedWidgetEventHandler eventHandler)
bool OnKeyUp(Widget w, int x, int y, int key)
proto native float GetStep()
proto native int GetUserID()
bool OnDropReceived(Widget w, int x, int y, Widget reciever)
proto native void SetTextBold(bool bold)
enum VideoCommand GetScrollbarWidth
proto native float GetHScrollPos()
bool OnClick(Widget w, int x, int y, int button)
bool OnDoubleClick(Widget w, int x, int y, int button)
static proto void SetTextLV(float lv)
Set global LV of the text in widgets, value between [-15, 0], default: 0, lower value is less bright.
bool OnFocusLost(Widget w, int x, int y)
proto native bool IsChecked()
bool LoadVideo(string name, int soundScene)
Legacy, preferably not used, left for backwards compat.
Definition EnWidgets.c:622
proto native bool Load(string name, bool looping=false, int startTime=0)
Load a video file.
static proto string TranslateString(string stringId)
proto native bool GetTextBold()
proto native void SetTextSpacing(int horiz, int vert)
proto native int GetTextOutlineSize()
bool OnController(Widget w, int control, int value)
control is one of ControlID
proto native int AddItem(string item)
proto native float GetHScrollPos01()
proto native void SetCurrent(float curr)
bool OnModalResult(Widget w, int x, int y, int code, int result)
WA_LEFT
Definition EnWidgets.c:0
proto native float GetContentHeight()
proto native void SetColor(int color)
proto native int GetCarriagePos()
proto native void SetText(string text, bool immedUpdate=true)
proto void GetScript(out Class data)
proto native bool IsSubtitlesDisabled()
Check if subtitles are disabled (enabled by default if available, so it will return false even if the...
proto native volatile void Update()
bool OnItemSelected(Widget w, int x, int y, int row, int column, int oldRow, int oldColumn)
proto native void SetRotation(float roll, float pitch, float yaw, bool immedUpdate=true)
bool OnFocus(Widget w, int x, int y)
proto native WidgetType GetTypeID()
proto native bool HScrollStep(int steps)
proto native void HScrollToPos01(float pos01)
proto native int GetImage()
Returns active image.
proto native void SetItem(int item, string value)
proto native bool SetState(bool state)
proto native int GetTextShadowSize()
proto native void ShowCursorWidget(bool show)
direct mouse cursor visibility control
proto native void ClearItems()
bool OnDraggingOver(Widget w, int x, int y, Widget reciever)
proto native float GetMaskTransitionWidth()
proto native void SetMinMax(float minimum, float maximum)
proto native void RemoveRow(int row)
proto void GetUserData(out Class data)
proto native void Enable(bool enable)
WorkspaceWidget Widget
Defined in code.
proto native int SetCurrentItem(int n)
proto native owned string GetStyleName()
proto native Widget FindWidget(string pathname)
proto native float GetContentOffset()
TypeID EventType
Definition EnWidgets.c:55
proto native void AddChildAfter(Widget child, Widget after, bool immedUpdate=true)
proto native bool GetBold()
proto native void SetTransform(vector mat[4], bool immedUpdate=true)
proto native int GetTextShadowColor()
proto string GetText()
proto native bool Pause()
Pauses video playback.
proto native void SetScreenSize(float w, float h, bool immedUpdate=true)
proto native void ElideText(int line, float maxWidth, string str)
bool OnEvent(EventType eventType, Widget target, int parameter0, int parameter1)
proto native void SetLooping(bool looping)
Set whether the video should loop.
proto native void SetScreenPos(float x, float y, bool immedUpdate=true)
proto native int GetFlags()
proto native void SetContentOffset(float offset, bool snapToLine=false)
proto native bool ReloadTexture(string path)
proto native float GetMin()
proto native bool IsControlClass()
bool OnDragging(Widget w, int x, int y, Widget reciever)
proto void GetTextSize(out int sx, out int sy)
Returns text size in pixels.
proto native bool SetTime(int time, bool preload)
Set the desired time for the video (preload decides whether it will already load the next frames too)
proto native bool SetImage(int num)
proto native float GetLineWidth(int line)
proto native void SetTextItalic(bool italic)
bool OnKeyDown(Widget w, int x, int y, int key)
proto native void HScrollToWidget(Widget child)
proto void SetCallback(VideoCallback cb, func fn)
Set a callback for a certain video event.
proto native bool VScrollStep(int steps)
proto native void SetBold(bool bold)
proto native void SetTextHorizontalAlignment(int align)
proto native void LoadWidgetStyles(string filename)
static proto void SetLV(float lv)
Set global LV of widgets, value between [-15, 0], default: 0, lower value is less bright.
proto native Widget GetWidgetUnderCursor()
proto native int GetTotalTime()
Get the total time of the video.
proto native void HScrollToPos(float pos)
proto native int AddItem(string text, Class userData, int column, int row=-1)
Insert new Row, if row = -1, new Row is inserted at the end otherwise at row index.
proto native bool IsVisibleHierarchy()
proto native bool IsVisible()
WA_TOP
Definition EnWidgets.c:3
proto native void SetItalic(bool italic)
proto native float GetAlpha()
proto native float GetTextShadowOffsetY()
WA_CENTER
Definition EnWidgets.c:2
proto native int SetFlags(int flags, bool immedUpdate=true)
proto native owned string GetName()
bool OnChildRemove(Widget w, Widget child)
proto native void RemoveChild(Widget child)
proto native void SetStep(float step)
proto native void VScrollToPos(float pos)
proto native void SetTextOffset(int left, int top)
proto native external Widget CreateWidget(WidgetType type, int left, int top, int width, int height, WidgetFlags flags, int color, int sort, Widget parentWidget=NULL)
Create widgets by WidgetType.
proto native void SetUserData(Class data)
WidgetAlignment
Definition EnWidgets.c:89
proto native void SetItemColor(int row, int column, int color)
proto native float GetTextShadowOpacity()
proto native vector GetRotation()
returns rotation of widget in order roll, pitch, yaw
proto native int GetSort()
proto native void SetMaskProgress(float value)
proto native void SetUV(float uv[4][2])
proto native float SetLineBreakingOverride(int mode)
proto native float GetShadowOpacity()
proto native void SetContentAlignmentV(WidgetAlignment alignment)
proto native void SetUserID(int id)
proto native void SetResolutionScale(float xscale, float ycale)
proto native Widget CancelWidgetDragging()
proto native void SetHideText(bool hide)
proto void GetText(out string text)
proto native bool GetItalic()
proto native int GetShadowSize()
proto native float GetTextProportion()
Get text proportion - ratio between button height and button text height in interval <0,...
proto native void SetMaskTransitionWidth(float value)
proto native int GetNumItems()
proto native float GetTextProportion()
Get text proportion - ratio between button height and button text height in interval <0,...
bool OnResize(Widget w, int x, int y)
proto native void SetImageTexture(int image, RTTextureWidget texture)
proto native void ClearAll()
WA_RIGHT
Definition EnWidgets.c:1
proto native Widget GetDragWidget()
proto native int GetSelectedRow()
proto native void SetGUIWidget(IEntity ent, int index, RTTextureWidget w)
proto native void DrawLine(float x1, float y1, float x2, float y2, float width, int color)
proto native WidgetAlignment GetContentAlignmentV()
proto native int ClearFlags(int flags, bool immedUpdate=true)
proto void GetText(out string text)
proto native void SetModal(Widget w)
proto native void SetSort(int sort, bool immedUpdate=true)
proto void GetScreenPos(out float x, out float y)
proto native void SetCursorWidget(Widget cursor)
bool OnKeyPress(Widget w, int x, int y, int key)
proto native bool LoadWidgetImageSet(string filename)
proto native bool LoadImageFile(int num, string name, bool noCache=false)
proto native void Unload()
Unload the video, freeing up all resources.
proto native bool SetActiveWindow(Widget w, bool resetFocus)
proto native void SetTextOffset(float xoffset, float yoffset)
proto native bool IsLooping()
Whether looping is enabled.
int Play(VideoCommand cmd)
Legacy, preferably not used, left for backwards compat.
Definition EnWidgets.c:587
proto native Widget GetChildren()
proto native void SetTextExactSize(int size)
set text exact size. Exact Text flag must be enabled. 0 equals original size.
proto native float GetContentHeight()
@ PLAY
Definition EnWidgets.c:507
@ REWIND
Definition EnWidgets.c:509
@ STOP
Definition EnWidgets.c:508
@ KILL
Definition EnWidgets.c:513
@ ISPLAYING
Definition EnWidgets.c:512
@ REPEAT
Definition EnWidgets.c:511
@ POSITION
Definition EnWidgets.c:510
@ CID_RADIALMENU
Definition EnWidgets.c:646
@ CID_SELECT
Definition EnWidgets.c:636
@ CID_NONE
Definition EnWidgets.c:635
@ CID_TABLEFT
Definition EnWidgets.c:644
@ CID_TABRIGHT
Definition EnWidgets.c:645
@ CID_LEFT
Definition EnWidgets.c:638
@ CID_RIGHT
Definition EnWidgets.c:639
@ CID_UP
Definition EnWidgets.c:640
@ CID_DRAG
Definition EnWidgets.c:643
@ CID_BACK
Definition EnWidgets.c:637
@ CID_COUNT
Definition EnWidgets.c:647
@ CID_MENU
Definition EnWidgets.c:642
@ CID_DOWN
Definition EnWidgets.c:641
@ STOPPED
The video is paused at the beginning of the video.
Definition EnWidgets.c:525
@ NONE
There is no video.
Definition EnWidgets.c:519
@ PAUSED
The video is paused.
Definition EnWidgets.c:523
@ FINISHED
The video is paused at the end of the video.
Definition EnWidgets.c:527
@ PLAYING
The video is playing.
Definition EnWidgets.c:521
@ FLIPU
Definition EnWidgets.c:75
@ CLIPCHILDREN
Definition EnWidgets.c:81
@ EXACTSIZE
Definition EnWidgets.c:71
@ CENTER
Definition EnWidgets.c:64
@ CUSTOMUV
Definition EnWidgets.c:77
@ RALIGN
Definition EnWidgets.c:73
@ EXACTPOS
Definition EnWidgets.c:68
@ FLIPV
Definition EnWidgets.c:76
@ BLEND
Definition EnWidgets.c:60
@ DRAGGABLE
Definition EnWidgets.c:84
@ HEXACTSIZE
Definition EnWidgets.c:69
@ IGNOREPOINTER
Definition EnWidgets.c:78
@ NOFOCUS
Definition EnWidgets.c:80
@ HEXACTPOS
Definition EnWidgets.c:66
@ VCENTER
Definition EnWidgets.c:65
@ STRETCH
Definition EnWidgets.c:74
@ VEXACTSIZE
Definition EnWidgets.c:70
@ NOCLEAR
Definition EnWidgets.c:83
@ SOURCEALPHA
Definition EnWidgets.c:59
@ VEXACTPOS
Definition EnWidgets.c:67
@ RENDER_ALWAYS
Definition EnWidgets.c:82
@ VISIBLE
Definition EnWidgets.c:62
@ ADDITIVE
Definition EnWidgets.c:61
@ NOFILTER
Definition EnWidgets.c:72
@ DISABLED
Definition EnWidgets.c:79
@ NOWRAP
Definition EnWidgets.c:63
@ ON_PAUSE
Definition EnWidgets.c:533
@ ON_END
Definition EnWidgets.c:535
@ ON_BUFFERING_START
Definition EnWidgets.c:538
@ ON_STOP
Definition EnWidgets.c:534
@ ON_SEEK
Definition EnWidgets.c:537
@ ON_LOAD
Definition EnWidgets.c:536
@ ON_BUFFERING_END
Definition EnWidgets.c:539
@ ON_PLAY
Definition EnWidgets.c:532