M
Matt Benner
Guest
I'm trying to draw a custom high scores table but any time the draw object runs I get the following error
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object obj_drawScores:
ds_grid_get argument 1 incorrect type (array) expecting a Number (YYGI32)
at gml_Object_obj_drawScores_Draw_0 (line 45) - draw_text(640,256 +(i*64), ds_grid_get(global.HighScoresArray, 0, i));
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_drawScores_Draw_0 (line 45)
Here is the code in question
for (var i = 0; i < 10; ++i)
{
draw_text(448,256 +(i*64), i + 1);
draw_text(640,256 +(i*64), ds_grid_get(global.HighScoresArray, 0, i));
draw_text(832,256 +(i*64), ds_grid_get(global.HighScoresArray, 1, i));
}
The array itself is created during game startup and populated before the player enters the high score room where the table is to be drawn. I'm sure i just messing this up somehow, can anyone see what the issue is?
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object obj_drawScores:
ds_grid_get argument 1 incorrect type (array) expecting a Number (YYGI32)
at gml_Object_obj_drawScores_Draw_0 (line 45) - draw_text(640,256 +(i*64), ds_grid_get(global.HighScoresArray, 0, i));
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_drawScores_Draw_0 (line 45)
Here is the code in question
for (var i = 0; i < 10; ++i)
{
draw_text(448,256 +(i*64), i + 1);
draw_text(640,256 +(i*64), ds_grid_get(global.HighScoresArray, 0, i));
draw_text(832,256 +(i*64), ds_grid_get(global.HighScoresArray, 1, i));
}
The array itself is created during game startup and populated before the player enters the high score room where the table is to be drawn. I'm sure i just messing this up somehow, can anyone see what the issue is?