Jump to content


Photo

Text not being draw problem


  • Please log in to reply
9 replies to this topic

#1 Masterjohn74

Masterjohn74

    GMC Member

  • New Member
  • 358 posts

Posted 07 March 2012 - 03:46 AM

For some reason the text in my game isn't being draw. It is all in the draw event and it should draw but nothing comes out. Could it be that the game is to big because it is really big.
Here are the texts:
draw_set_color(make_color_rgb(1,1,137))
draw_set_font(font_large)
draw_text(0,0,string("The Good"))
draw_text(1024-284,0,string("The Bad"))
draw_text(room_width/2-188,300,string("The Blood"))
draw_text(416,768,string("Back"))
draw_text((room_width/2)-173,23,string("Click for"))
draw_text(416,58,string("info"))
}
  • 0

#2 Jakyl11

Jakyl11

    GMC Member

  • GMC Member
  • 3109 posts
  • Version:GM:Studio

Posted 07 March 2012 - 04:10 AM

if your using views you need to draw it to the view like so

draw_text(view_xview[0]+5,view_yview[0]+5,"Text Here");

Edited by Jakyl11, 07 March 2012 - 04:10 AM.

  • 0

#3 Masterjohn74

Masterjohn74

    GMC Member

  • New Member
  • 358 posts

Posted 07 March 2012 - 05:20 AM

its weird that it sometimes works and sometimes dosent
  • 0

#4 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • Retired Staff
  • 9259 posts
  • Version:Unknown

Posted 07 March 2012 - 05:47 AM

First of all, you don't need to put string() around something that's already a string. The string() function is only for converting numbers into strings.

But that shouldn't cause your problem.

I notice your code ends with a closing } bracket, but we don't see the opening bracket. Perhaps the problem is something slightly above the actual drawing? Can you please post the full code?

Also, if you're using views, take Jakyl11's advice about offsetting the coordinates with the view.

-IMP
  • 0

#5 Masterjohn74

Masterjohn74

    GMC Member

  • New Member
  • 358 posts

Posted 10 March 2012 - 01:57 AM

First of all, you don't need to put string() around something that's already a string. The string() function is only for converting numbers into strings.

But that shouldn't cause your problem.

I notice your code ends with a closing } bracket, but we don't see the opening bracket. Perhaps the problem is something slightly above the actual drawing? Can you please post the full code?

Also, if you're using views, take Jakyl11's advice about offsetting the coordinates with the view.

-IMP

Here is the full code:

if back_num!=noone{
draw_background(back_num,x,y)}
if back_num=noone{
draw_sprite_stretched(info_room_sp,0,0,0,1024,819)
draw_sprite_stretched(BCell_D,0,0,96,64,64)
draw_sprite_stretched(Baso_D,0,0,224,64,64)
draw_sprite_stretched(Mono_Ul,0,0,352,64,64)
draw_sprite_stretched(white_D,0,0,480,64,64)
draw_sprite_stretched(Neut_D,0,0,608,64,64)
draw_sprite_stretched(Tcell_D,0,0,736,64,64)
draw_sprite_stretched(rhinovirus_D,0,960,96,64,64)
draw_sprite_stretched(Bron_U,0,960,224,64,64)
draw_sprite_stretched(influenza_R,0,960,352,64,64)
draw_sprite_stretched(Noro_Dl,0,960,480,64,64)
draw_sprite_stretched(ch_Dr,0,960,608,64,64)
draw_sprite(rd_cl,0,room_width/2,room_height/2)
draw_set_font(font_large)
draw_text(view_xview[0]+0,view_yview[0]+0,string("The Good"))
draw_text(view_xview[0]+1024-284,view_yview[0]+0,string("The Bad"))
draw_text(view_xview[0]+room_width/2-188,view_yview[0]+300,string("The Blood"))
draw_text(view_xview[0]+416,view_yview[0]+768,string("Back"))
draw_set_color(make_color_rgb(1,1,137))
draw_text(view_xview[0]+(room_width/2)-173,view_yview[0]+23,string("Click for"))
draw_text(view_xview[0]+416,view_yview[0]+58,string("info"))
draw_text(view_xview[0]+1024-454,view_yview[0]+819-40,string("How to Play"))
}
back_num is the background but that doesn't seem to be the problem since nothing shows up.
  • 0

#6 TheouAegis

TheouAegis

    GMC Member

  • GMC Member
  • 4672 posts
  • Version:GM8

Posted 10 March 2012 - 07:22 AM

Is it just the text that doesn't get drawn or nothing at all?

Make sure the object that has all this code in it has its "visible" flag set. Objects must be visible to use the Draw event.
  • 0

#7 Masterjohn74

Masterjohn74

    GMC Member

  • New Member
  • 358 posts

Posted 11 March 2012 - 12:56 AM

yes the visible box is checked and is being drawn. if the text is being drawn the background would have been.
  • 0

#8 TheouAegis

TheouAegis

    GMC Member

  • GMC Member
  • 4672 posts
  • Version:GM8

Posted 11 March 2012 - 03:06 AM

Probably won't help, but try using -1, -2, -3 or -4 in place of "noone" and see if that changes anything.
Also try using view_current unless you're only using one view. Make sure that one view is view[0] too.

I'm shooting for the stars here. :mellow:
  • 0

#9 BattleRifle BR55

BattleRifle BR55

    Moo

  • GMC Member
  • 8246 posts
  • Version:GM7

Posted 11 March 2012 - 03:24 AM

If you use another font (say, the default one), does it work perfectly?
  • 0

#10 Masterjohn74

Masterjohn74

    GMC Member

  • New Member
  • 358 posts

Posted 11 March 2012 - 09:46 PM

well if there is no clear solution than it is probably a bug when the game gets to big.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users