1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
|
#include "main.h"
#include "state.h"
#include "rgui.h"
#include "lua_core.h"
#define RAYGUI_IMPLEMENTATION
#include "raygui.h"
/*
## Gui - Global
*/
/*
> RL.GuiEnable()
Enable gui controls (global state)
*/
int lguiGuiEnable( lua_State *L ) {
GuiEnable();
return 0;
}
/*
> RL.GuiDisable()
Disable gui controls (global state)
*/
int lguiGuiDisable( lua_State *L ) {
GuiDisable();
return 0;
}
/*
> RL.GuiLock()
Lock gui controls (global state)
*/
int lguiGuiLock( lua_State *L ) {
GuiLock();
return 0;
}
/*
> RL.GuiUnlock()
Unlock gui controls (global state)
*/
int lguiGuiUnlock( lua_State *L ) {
GuiUnlock();
return 0;
}
/*
> locked = RL.GuiIsLocked()
Check if gui is locked (global state)
- Success return bool
*/
int lguiGuiIsLocked( lua_State *L ) {
lua_pushboolean( L, GuiIsLocked() );
return 0;
}
/*
> RL.GuiFade( float alpha )
Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f
*/
int lguiGuiFade( lua_State *L ) {
float alpha = luaL_checknumber( L, 1 );
GuiFade( alpha );
return 0;
}
/*
> RL.GuiSetState( int state )
Set gui state (global state)
*/
int lguiGuiSetState( lua_State *L ) {
int state = luaL_checkinteger( L, 1 );
GuiSetState( state );
return 0;
}
/*
> state = RL.GuiGetState()
Get gui state (global state)
- Success return int
*/
int lguiGuiGetState( lua_State *L ) {
lua_pushinteger( L, GuiGetState() );
return 1;
}
/*
## Gui - Font
*/
/*
> RL.GuiSetFont( Font font )
Set gui custom font (global state)
*/
int lguiGuiSetFont( lua_State *L ) {
Font *font = luaL_checkudata( L, 1, "Font" );
GuiSetFont( *font );
return 0;
}
/*
> font = RL.GuiGetFont()
Get gui custom font (global state)
- Success return Font
*/
int lguiGuiGetFont( lua_State *L ) {
uluaPushFont( L, GuiGetFont() );
return 1;
}
/*
## Gui - Style
*/
/*
> RL.GuiSetStyle( int control, int property, int value )
Set one style property
*/
int lguiGuiSetStyle( lua_State *L ) {
int control = luaL_checkinteger( L, 1 );
int property = luaL_checkinteger( L, 2 );
int value = luaL_checkinteger( L, 3 );
GuiSetStyle( control, property, value );
return 0;
}
/*
> value = RL.GuiGetStyle( int control, int property )
Get one style property
- Success return int
*/
int lguiGuiGetStyle( lua_State *L ) {
int control = luaL_checkinteger( L, 1 );
int property = luaL_checkinteger( L, 2 );
lua_pushinteger( L, GuiGetStyle( control, property ) );
return 1;
}
/*
> success = RL.GuiLoadStyle( string fileName )
Load style file over global style variable (.rgs)
- Failure return false
- Success return true
*/
int lguiGuiLoadStyle( lua_State *L ) {
if ( FileExists( luaL_checkstring( L, 1 ) ) ) {
GuiLoadStyle( lua_tostring( L, 1 ) );
lua_pushboolean( L, true );
return 1;
}
TraceLog( state->logLevelInvalid, "Invalid file '%s'", lua_tostring( L, 1 ) );
lua_pushboolean( L, false );
return 1;
}
/*
> RL.GuiLoadStyleDefault()
Load style default over global style
*/
int lguiGuiLoadStyleDefault( lua_State *L ) {
GuiLoadStyleDefault();
return 0;
}
/*
## Gui - Container
*/
/*
> state = RL.GuiWindowBox( Rectangle bounds, string title )
Window Box control, shows a window that can be closed
- Success return bool
*/
int lguiGuiWindowBox( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
lua_pushboolean( L, GuiWindowBox( bounds, luaL_checkstring( L, 2 ) ) );
return 1;
}
/*
> RL.GuiGroupBox( Rectangle bounds, string text )
Group Box control with text name
*/
int lguiGuiGroupBox( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
GuiGroupBox( bounds, luaL_checkstring( L, 2 ) );
return 0;
}
/*
> RL.GuiLine( Rectangle bounds, string text )
Line separator control, could contain text
*/
int lguiGuiLine( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
GuiLine( bounds, luaL_checkstring( L, 2 ) );
return 0;
}
/*
> RL.GuiPanel( Rectangle bounds, string text )
Panel control, useful to group controls
*/
int lguiGuiPanel( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
GuiPanel( bounds, luaL_checkstring( L, 2 ) );
return 0;
}
/*
> view, scroll = RL.GuiScrollPanel( Rectangle bounds, string text, Rectangle content, Vector2 scroll )
Scroll Panel control
- Success return Rectangle, Vector2
*/
int lguiGuiScrollPanel( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
Rectangle content = uluaGetRectangleIndex( L, 3 );
Vector2 scroll = uluaGetVector2Index( L, 4 );
uluaPushRectangle( L, GuiScrollPanel( bounds, luaL_checkstring( L, 2 ), content, &scroll ) );
uluaPushVector2( L, scroll );
return 2;
}
/*
## Gui - Basic
*/
/*
> RL.GuiLabel( Rectangle bounds, string text )
Label control, shows text
*/
int lguiGuiLabel( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
GuiLabel( bounds, luaL_checkstring( L, 2 ) );
return 0;
}
/*
> clicked = RL.GuiButton( Rectangle bounds, string text )
Button control, returns true when clicked
- Success return boolean
*/
int lguiGuiButton( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
lua_pushboolean( L, GuiButton( bounds, luaL_checkstring( L, 2 ) ) );
return 1;
}
/*
> clicked = RL.GuiLabelButton( Rectangle bounds, string text )
Label button control, show true when clicked
- Success return boolean
*/
int lguiGuiLabelButton( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
lua_pushboolean( L, GuiLabelButton( bounds, luaL_checkstring( L, 2 ) ) );
return 1;
}
/*
> active = RL.GuiToggle( Rectangle bounds, string text, bool active )
Toggle Button control, returns true when active
- Success return boolean
*/
int lguiGuiToggle( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
bool checked = lua_toboolean( L, 3 );
lua_pushboolean( L, GuiToggle( bounds, luaL_checkstring( L, 2 ), checked ) );
return 1;
}
/*
> index = RL.GuiToggleGroup( Rectangle bounds, string text, int active )
Toggle Group control, returns active toggle index
- Success return int
*/
int lguiGuiToggleGroup( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
int active = luaL_checkinteger( L, 3 );
lua_pushinteger( L, GuiToggleGroup( bounds, luaL_checkstring( L, 2 ), active ) );
return 1;
}
/*
> active = RL.GuiCheckBox( Rectangle bounds, string text, bool checked )
Check Box control, returns true when active
- Success return boolean
*/
int lguiGuiCheckBox( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
bool checked = lua_toboolean( L, 3 );
lua_pushboolean( L, GuiCheckBox( bounds, luaL_checkstring( L, 2 ), checked ) );
return 1;
}
/*
> active = RL.GuiComboBox( Rectangle bounds, string text, int active )
Combo Box control, returns selected item index
- Success return int
*/
int lguiGuiComboBox( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
int active = luaL_checkinteger( L, 3 );
lua_pushinteger( L, GuiComboBox( bounds, luaL_checkstring( L, 2 ), active ) );
return 1;
}
/*
> pressed, text = RL.GuiTextBox( Rectangle bounds, string text, int textSize, bool editMode )
Text Box control, updates input text
- Success return boolean, string
*/
int lguiGuiTextBox( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
int textSize = luaL_checkinteger( L, 3 );
// char text[ STRING_LEN ] = { '\0' };
char text[ textSize + 1 ];
strcpy( text, luaL_checkstring( L, 2 ) );
bool editMode = lua_toboolean( L, 4 );
lua_pushboolean( L, GuiTextBox( bounds, text, textSize, editMode ) );
lua_pushstring( L, text );
return 2;
}
/*
> pressed, text = RL.GuiTextBoxMulti( Rectangle bounds, string text, int textSize, bool editMode )
Text Box control with multiple lines
- Success return boolean, string
*/
int lguiGuiTextBoxMulti( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
int textSize = luaL_checkinteger( L, 3 );
// char text[ STRING_LEN ] = { '\0' };
char text[ textSize + 1 ];
strcpy( text, luaL_checkstring( L, 2 ) );
bool editMode = lua_toboolean( L, 4 );
lua_pushboolean( L, GuiTextBoxMulti( bounds, text, textSize, editMode ) );
lua_pushstring( L, text );
return 2;
}
/*
> pressed, value = RL.GuiSpinner( Rectangle bounds, string text, int value, int minValue, int maxValue, bool editMode )
Spinner control, returns selected value
- Success return boolean, int
*/
int lguiGuiSpinner( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
int value = luaL_checkinteger( L, 3 );
int minValue = luaL_checkinteger( L, 4 );
int maxValue = luaL_checkinteger( L, 5 );
bool editMode = lua_toboolean( L, 6 );
lua_pushboolean( L, GuiSpinner( bounds, luaL_checkstring( L, 2 ), &value, minValue, maxValue, editMode ) );
lua_pushinteger( L, value );
return 2;
}
/*
> pressed, value = RL.GuiValueBox( Rectangle bounds, string text, int value, int minValue, int maxValue, bool editMode )
Value Box control, updates input text with numbers
- Success return boolean, int
*/
int lguiGuiValueBox( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
int value = luaL_checkinteger( L, 3 );
int minValue = luaL_checkinteger( L, 4 );
int maxValue = luaL_checkinteger( L, 5 );
bool editMode = lua_toboolean( L, 6 );
lua_pushboolean( L, GuiValueBox( bounds, luaL_checkstring( L, 2 ), &value, minValue, maxValue, editMode ) );
lua_pushinteger( L, value );
return 2;
}
/*
> value = RL.GuiSlider( Rectangle bounds, string textLeft, string textRight, float value, float minValue, float maxValue )
Slider control, returns selected value
- Success return float
*/
int lguiGuiSlider( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
float value = luaL_checknumber( L, 4 );
float minValue = luaL_checknumber( L, 5 );
float maxValue = luaL_checknumber( L, 6 );
lua_pushnumber( L, GuiSlider( bounds, luaL_checkstring( L, 2 ), luaL_checkstring( L, 3 ), value, minValue, maxValue ) );
return 1;
}
/*
> value = RL.GuiSliderBar( Rectangle bounds, string textLeft, string textRight, float value, float minValue, float maxValue )
Slider Bar control, returns selected value
- Success return float
*/
int lguiGuiSliderBar( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
float value = luaL_checknumber( L, 4 );
float minValue = luaL_checknumber( L, 5 );
float maxValue = luaL_checknumber( L, 6 );
lua_pushnumber( L, GuiSliderBar( bounds, luaL_checkstring( L, 2 ), luaL_checkstring( L, 3 ), value, minValue, maxValue ) );
return 1;
}
/*
> value = RL.GuiProgressBar( Rectangle bounds, string textLeft, string textRight, float value, float minValue, float maxValue )
Progress Bar control, shows current progress value
- Success return float
*/
int lguiGuiProgressBar( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
float value = luaL_checknumber( L, 4 );
float minValue = luaL_checknumber( L, 5 );
float maxValue = luaL_checknumber( L, 6 );
lua_pushnumber( L, GuiProgressBar( bounds, luaL_checkstring( L, 2 ), luaL_checkstring( L, 3 ), value, minValue, maxValue ) );
return 1;
}
/*
> value = RL.GuiScrollBar( Rectangle bounds, int value, int minValue, int maxValue )
Scroll Bar control
- Success return int
*/
int lguiGuiScrollBar( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
int value = luaL_checkinteger( L, 2 );
int minValue = luaL_checkinteger( L, 3 );
int maxValue = luaL_checkinteger( L, 4 );
lua_pushinteger( L, GuiScrollBar( bounds, value, minValue, maxValue ) );
return 1;
}
/*
> pressed, item = RL.GuiDropdownBox( Rectangle bounds, string text, int active, bool editMode )
Dropdown Box control, returns selected item
- Success return bool, int
*/
int lguiGuiDropdownBox( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
int active = luaL_checkinteger( L, 3 );
bool editMode = lua_toboolean( L, 4 );
lua_pushboolean( L, GuiDropdownBox( bounds, luaL_checkstring( L, 2 ), &active, editMode ) );
lua_pushinteger( L, active );
return 2;
}
/*
> RL.GuiStatusBar( Rectangle bounds, string text )
Status Bar control, shows info text
*/
int lguiGuiStatusBar( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
GuiStatusBar( bounds, luaL_checkstring( L, 2 ) );
return 0;
}
/*
> RL.GuiDummyRec( Rectangle bounds, string text )
Dummy control for placeholders
*/
int lguiGuiDummyRec( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
GuiDummyRec( bounds, luaL_checkstring( L, 2 ) );
return 0;
}
/*
> cell = RL.GuiGrid( Rectangle bounds, string text, float spacing, int subdivs )
Grid control, returns mouse cell position
- Success return Vector2
*/
int lguiGuiGrid( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
float spacing = luaL_checknumber( L, 3 );
int subdivs = luaL_checkinteger( L, 4 );
uluaPushVector2( L, GuiGrid( bounds, luaL_checkstring( L, 2 ), spacing, subdivs ) );
return 1;
}
/*
## Gui - Advanced
*/
/*
> itemIndex, scrollIndex = RL.GuiListView( Rectangle bounds, string text, int scrollIndex, int active )
List View control, returns selected list item index and scroll index
- Success return int, int
*/
int lguiGuiListView( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
int scrollIndex = luaL_checkinteger( L, 3 );
int active = luaL_checkinteger( L, 4 );
lua_pushinteger( L, GuiListView( bounds, luaL_checkstring( L, 2 ), &scrollIndex, active ) );
lua_pushinteger( L, scrollIndex );
return 2;
}
/*
> itemIndex, scrollIndex, focus = RL.GuiListViewEx( Rectangle bounds, string text, int focus, int scrollIndex, int active )
List View with extended parameters, returns selected list item index, scroll index and focus
- Success return int, int, int
*/
int lguiGuiListViewEx( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
int focus = luaL_checkinteger( L, 3 );
int scrollIndex = luaL_checkinteger( L, 4 );
int active = luaL_checkinteger( L, 5 );
int count = 0;
const char **text = GuiTextSplit( luaL_checkstring( L, 2 ), &count, NULL );
lua_pushinteger( L, GuiListViewEx( bounds, text, count, &focus, &scrollIndex, active ) );
lua_pushinteger( L, scrollIndex );
lua_pushinteger( L, focus );
return 3;
}
/*
> buttonIndex = RL.GuiMessageBox( Rectangle bounds, string title, string message, string buttons )
Message Box control, displays a message, returns button index (0 is x button)
- Success return int
*/
int lguiGuiMessageBox( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
lua_pushinteger( L, GuiMessageBox( bounds, luaL_checkstring( L, 2 ), luaL_checkstring( L, 3 ), luaL_checkstring( L, 4 ) ) );
return 1;
}
/*
> buttonIndex, text, secretViewActive = RL.GuiTextInputBox( Rectangle bounds, string title, string message, string buttons, string text, int textMaxSize, int secretViewActive )
Text Input Box control, ask for text, supports secret
- Success return int, string, int
*/
int lguiGuiTextInputBox( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
int textMaxSize = luaL_checkinteger( L, 6 );
int secretViewActive = luaL_checkinteger( L, 7 );
char text[ textMaxSize + 1 ];
strcpy( text, luaL_checkstring( L, 5 ) );
lua_pushinteger( L, GuiTextInputBox( bounds, luaL_checkstring( L, 2 ), luaL_checkstring( L, 3 ), luaL_checkstring( L, 4 ), text, textMaxSize, &secretViewActive ) );
lua_pushstring( L, text );
lua_pushinteger( L, secretViewActive );
return 3;
}
/*
> color = RL.GuiColorPicker( Rectangle bounds, string text, Color color )
Color Picker control (multiple color controls)
- Success return Color
*/
int lguiGuiColorPicker( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
Color color = uluaGetColorIndex( L, 3 );
uluaPushColor( L, GuiColorPicker( bounds, luaL_checkstring( L, 2 ), color ) );
return 1;
}
/*
> color = RL.GuiColorPanel( Rectangle bounds, string text, Color color )
Color Panel control
- Success return Color
*/
int lguiGuiColorPanel( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
Color color = uluaGetColorIndex( L, 3 );
uluaPushColor( L, GuiColorPanel( bounds, luaL_checkstring( L, 2 ), color ) );
return 1;
}
/*
> alpha = RL.GuiColorBarAlpha( Rectangle bounds, string text, float alpha )
Color Bar Alpha control
- Success return float
*/
int lguiGuiColorBarAlpha( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
float alpha = luaL_checknumber( L, 3 );
lua_pushnumber( L, GuiColorBarAlpha( bounds, luaL_checkstring( L, 2 ), alpha ) );
return 1;
}
/*
> hue = RL.GuiColorBarHue( Rectangle bounds, string text, float value )
Color Bar Hue control
- Success return float
*/
int lguiGuiColorBarHue( lua_State *L ) {
Rectangle bounds = uluaGetRectangleIndex( L, 1 );
float value = luaL_checknumber( L, 3 );
lua_pushnumber( L, GuiColorBarHue( bounds, luaL_checkstring( L, 2 ), value ) );
return 1;
}
/*
## Gui - Icons
*/
/*
> text = RL.GuiIconText( int iconId, string text )
Get text with icon id prepended (if supported)
- Success return string
*/
int lguiGuiIconText( lua_State *L ) {
int iconId = luaL_checkinteger( L, 1 );
if ( TextIsEqual( luaL_checkstring( L, 2 ), "" ) ) {
lua_pushstring( L, GuiIconText( iconId, NULL ) );
}
else {
lua_pushstring( L, GuiIconText( iconId, luaL_checkstring( L, 2 ) ) );
}
return 1;
}
/*
> RL.GuiDrawIcon( int iconId, Vector2 pos, int pixelSize, Color color )
Draw icon
*/
int lguiGuiDrawIcon( lua_State *L ) {
int iconId = luaL_checkinteger( L, 1 );
Vector2 pos = uluaGetVector2Index( L, 2 );
int pixelSize = luaL_checkinteger( L, 3 );
Color color = uluaGetColorIndex( L, 4 );
GuiDrawIcon( iconId, pos.x, pos.y, pixelSize, color );
return 0;
}
/*
> RL.GuiSetIconScale( int scale )
Set icon scale (1 by default)
*/
int lguiGuiSetIconScale( lua_State *L ) {
unsigned int scale = luaL_checkinteger( L, 1 );
GuiSetIconScale( scale );
return 0;
}
/*
> RL.GuiSetIconPixel( int iconId, Vector2 pos )
Set icon pixel value
*/
int lguiGuiSetIconPixel( lua_State *L ) {
int iconId = luaL_checkinteger( L, 1 );
Vector2 pos = uluaGetVector2Index( L, 2 );
GuiSetIconPixel( iconId, pos.x, pos.y );
return 0;
}
/*
> RL.GuiClearIconPixel( int iconId, Vector2 pos )
Clear icon pixel value
*/
int lguiGuiClearIconPixel( lua_State *L ) {
int iconId = luaL_checkinteger( L, 1 );
Vector2 pos = uluaGetVector2Index( L, 2 );
GuiClearIconPixel( iconId, pos.x, pos.y );
return 0;
}
/*
> value = RL.GuiCheckIconPixel( int iconId, Vector2 pos )
Check icon pixel value
- Success return bool
*/
int lguiGuiCheckIconPixel( lua_State *L ) {
int iconId = luaL_checkinteger( L, 1 );
Vector2 pos = uluaGetVector2Index( L, 2 );
lua_pushboolean( L, GuiCheckIconPixel( iconId, pos.x, pos.y ) );
return 1;
}
|