@@ -1435,6 +1435,17 @@ ctr_object* ctr_line_end(ctr_object* myself, ctr_argument* argumentList) {
1435
1435
return ctr_internal_object_property (myself , CTR_DICT_TO , NULL );
1436
1436
}
1437
1437
1438
+ /**
1439
+ * @def
1440
+ * [ Color ] new
1441
+ *
1442
+ * @example
1443
+ * ☞ media ≔ Media new.
1444
+ * ☞ x ≔ Color new.
1445
+ * ✎ write: x red, stop.
1446
+ * ✎ write: x green, stop.
1447
+ * ✎ write: x blue, stop.
1448
+ */
1438
1449
ctr_object * ctr_color_new (ctr_object * myself , ctr_argument * argumentList ) {
1439
1450
ctr_object * instance = ctr_internal_create_object (CTR_OBJECT_TYPE_OTOBJECT );
1440
1451
instance -> link = myself ;
@@ -1445,6 +1456,17 @@ ctr_object* ctr_color_new(ctr_object* myself, ctr_argument* argumentList) {
1445
1456
return instance ;
1446
1457
}
1447
1458
1459
+ /**
1460
+ * @def
1461
+ * [ Color ] red: [Number] green: [Number] blue [Number]
1462
+ *
1463
+ * @example
1464
+ * ☞ media ≔ Media new.
1465
+ * ☞ x ≔ Color new red: 100 green: 150 blue: 200.
1466
+ * ✎ write: x red, stop.
1467
+ * ✎ write: x green, stop.
1468
+ * ✎ write: x blue, stop.
1469
+ */
1448
1470
ctr_object * ctr_color_rgb_set (ctr_object * myself , ctr_argument * argumentList ) {
1449
1471
ctr_internal_object_property (myself , "r" , ctr_internal_cast2number (argumentList -> object ));
1450
1472
ctr_internal_object_property (myself , "g" , ctr_internal_cast2number (argumentList -> next -> object ));
@@ -1489,6 +1511,17 @@ void ctr_audio_destructor(ctr_resource* rs) {
1489
1511
mediaAUD -> ref = NULL ;
1490
1512
}
1491
1513
1514
+ /**
1515
+ * @def
1516
+ * [ Sound ] play
1517
+ *
1518
+ * @example
1519
+ * ☞ fx ≔ Sound new: ‘boom.mp3’.
1520
+ * fx play.
1521
+ *
1522
+ * @result
1523
+ * (plays sound)
1524
+ */
1492
1525
ctr_object * ctr_sound_new_set (ctr_object * myself , ctr_argument * argumentList ) {
1493
1526
if (AUDCount >= maxAUD ) return CtrStdNil ;
1494
1527
char * audioFileStr = ctr_heap_allocate_cstring (ctr_internal_cast2string (argumentList -> object ));
@@ -1566,6 +1599,21 @@ SDL_RWops* ctr_internal_media_load_asset(char* asset_name, char asset_type) {
1566
1599
return res ;
1567
1600
}
1568
1601
1602
+ /**
1603
+ * @def
1604
+ * [ Music ] play
1605
+ *
1606
+ * @example
1607
+ * ☞ j ≔ Music new: ‘jazz.mp3’.
1608
+ * j play.
1609
+ * Moment wait: 1.
1610
+ * j silence.
1611
+ * j rewind.
1612
+ *
1613
+ * @result
1614
+ * 𝄞 (plays music)
1615
+ *
1616
+ */
1569
1617
ctr_object * ctr_music_new_set (ctr_object * myself , ctr_argument * argumentList ) {
1570
1618
char * audioFileStr = ctr_heap_allocate_cstring (ctr_internal_cast2string (argumentList -> object ));
1571
1619
ctr_object * audioInst = ctr_audio_new (myself , argumentList );
0 commit comments