Rendering order

Monkey Forums/Monkey Programming/Rendering order

TeaBoy(Posted 2015) [#1]
Not sure if I will explain this very well, but here goes:

I am working on a command prompt for a website, so you type in your command, press
enter and the command is sent to a PHP script to perform the required action.

I am using an image for the cursor, whenever I comment out the DrawImage command
the responseText received from OnHttpRequestComplete is displayed. I can see the data
is being retrieved from request.ResponseText() but the data is not being displayed by DrawText.

Has anyone come across this before?

Any advice will be appreciated, many thanks!

Method OnRender()
   Cls(0, 0, 0)
   DrawBorder()
   
   'Output window
   SetScissor(8, 90, 625, 335)
   Cls(0, 0, 0)
   SetColor(255, 255, 255)
   DrawText(responseText, 15, 100) <--- This is shown when
                                                          DrawImage(getcursor, 44+TextWidth(text), 444)
                                                          is commented out.
                       
   
   'Command prompt
   SetScissor(10, 440, 620, 30)
   Cls(0, 0, 0)
   SetColor(0, 255, 0)
   
   If (cmdSend = True)
     DrawText("Sending Command... Please Wait...", 15, 447)
   Else
     DrawText("T:\>" + text, 15, 447)
     DrawImage(getcursor, 44+TextWidth(text), 444)
   End If
  End Method



MikeHart(Posted 2015) [#2]
2 CLS statements? I am surprised you see your responseText at all.
Maybe your cursor image is covering the text.


TeaBoy(Posted 2015) [#3]
Yeah, I could probably do without the other CLS commands as I was going to have different background colours for the
output window and the command prompt.

It doesn't seem the image is covering the text, if you put another DrawText below DrawText(responseText, 15, 100) to
display a string literal, the string is displayed fine.


tiresius(Posted 2015) [#4]
I see two variables, 'responseText' and 'text'. Are they the same thing?


TeaBoy(Posted 2015) [#5]
text stores the characters from GetChar