
-----------------------------------
evildaddy911
Wed Feb 29, 2012 8:50 am

is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
What is it you are trying to achieve?
a color fading module


What is the problem you are having?
my computer cant draw it fast enough, so it looks really crappy in a loop
Is there a function that tells you if offscreenonly is on?

Describe what you have tried to solve this problem
the documentation keeps saying "Navigation to webpage was cancelled"


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)




var see_below : string := "look at the attachment"



Please specify what version of Turing you are using


-----------------------------------
Dreadnought
Wed Feb 29, 2012 12:49 pm

Re: is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
Well, there is no way of determining if an output window is in offscreenonly mode.

But, you could create a separate window ad keep it hidden. Then you just have to draw your gradient to the hidden window, then copy the contents of that window to the window the user sees.

See [tdoc]windowmodule[/tdoc] for window commands.

-----------------------------------
Tony
Wed Feb 29, 2012 3:56 pm

RE:is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
Sure. You can try to draw something to the screen, and see if it appears.

-----------------------------------
Zren
Wed Feb 29, 2012 4:10 pm

RE:is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
Since only your code will determine if the buffer is offscreen or not, why not just manage a boolean yourself? Tip: Make a procedure to set the variable and call View.Set(...).

-----------------------------------
copthesaint
Wed Feb 29, 2012 4:17 pm

RE:is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
Its very easy to know if a screen is offscreenonly. If you havnt set offscreenonly then it is Initialized as nooffscreenonly

-----------------------------------
Velocity
Wed Feb 29, 2012 6:57 pm

RE:is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
you type View.set ("offscreenonly") if you typed it... its there no doubt. assuming you placed it at the very top of your function that you want it to be used for.

-----------------------------------
Tony
Wed Feb 29, 2012 7:17 pm

Re: RE:is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
Since only your code will determine if the buffer is offscreen or not...
Not if other people are using your library/package/whatever

-----------------------------------
evildaddy911
Wed Feb 29, 2012 10:36 pm

Re: RE:is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
Sure. You can try to draw something to the screen, and see if it appears.
Like  drawdot(-15,-15,black)
If whatdotcolor(-15,-15)= black then
Offscreen:=true

-----------------------------------
Tony
Wed Feb 29, 2012 11:20 pm

RE:is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
- if the dot gets drawn, it means offscreen is false.
- the screen could have already been black from before, so you'd need to draw twice, and look for that transition
-- which also means that if there's a forked thread, this is not deterministic (which is why forks and offscreenonly don't go together)

Of course you'd have to confirm that whatdotcolor actually reads from screen and not from the buffer into which offscreen draws.

-----------------------------------
Dan
Wed Feb 29, 2012 11:46 pm

Re: RE:is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
Sure. You can try to draw something to the screen, and see if it appears.
Like  drawdot(-15,-15,black)
If whatdotcolor(-15,-15)= black then
Offscreen:=true


- if the dot gets drawn, it means offscreen is false.
- the screen could have already been black from before, so you'd need to draw twice, and look for that transition
-- which also means that if there's a forked thread, this is not deterministic (which is why forks and offscreenonly don't go together)

Of course you'd have to confirm that whatdotcolor actually reads from screen and not from the buffer into which offscreen draws.


If i rember correctly whatdotcolor and pic.new read from the buffer and not the screen.

-----------------------------------
Velocity
Thu Mar 01, 2012 12:15 am

RE:is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
pic.new reads from buffer, whatdotcolor reads from screen

-----------------------------------
Dan
Thu Mar 01, 2012 2:06 am

Re: RE:is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
pic.new reads from buffer, whatdotcolor reads from screen

This does not seem to be true:


View.Set("graphics")
View.Set("offscreenonly")

var y: int := View.WhatDotColor(1,1)

Draw.Dot(1,1,y+1);
var x: int := View.WhatDotColor(1,1)

put y, x;


outputs:

[code]
01
[/code]

If WhatDotColor read the screen it should be 00.

Notice that you will get the same output with "nooffscreenonly", making this method unhelpfull for detecting if "offscreenonly" is on (i.e. evildaddy911's code will allways return true).

-----------------------------------
Velocity
Thu Mar 01, 2012 3:27 pm

RE:is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
hmm, thats odd. When i tested it, it begged to differ. Oh well, i guess there was something wrong with the way i wrote it. So ofcourse ill take your word over my compilers. Thanks for the clear up, dan.

-----------------------------------
Dan
Thu Mar 01, 2012 6:52 pm

Re: RE:is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
hmm, thats odd. When i tested it, it begged to differ. Oh well, i guess there was something wrong with the way i wrote it. So ofcourse ill take your word over my compilers. Thanks for the clear up, dan.

What was your code? And what does your complier output for the same code i posted?

-----------------------------------
Velocity
Fri Mar 02, 2012 12:07 am

RE:is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
yes, it said 00

-----------------------------------
Dan
Fri Mar 02, 2012 12:36 am

Re: RE:is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
yes, it said 00

What version of turing?

-----------------------------------
Velocity
Fri Mar 02, 2012 9:58 am

RE:is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
4.1

-----------------------------------
Insectoid
Fri Mar 02, 2012 10:41 am

Re: RE:is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
pic.new reads from buffer, whatdotcolor reads from screen

whatdotcolor reading from the buffer is a big part of whatdotcolor collision detection.

-----------------------------------
Dan
Fri Mar 02, 2012 1:17 pm

Re: RE:is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
4.1

I just tested it in 4.1 and got "01". Normaly I would just assume you are mistaken or their is somthing odd going on with your copy of turing. However, you seem to have a history of making b.s. posts you can't back up (e.g. the lanschool thread). Please stop spreading disinformation or your account will be banned (you are only 1 warnning from a ban as it is).

-----------------------------------
Aange10
Sat Mar 03, 2012 10:33 am

RE:is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
I also get "01", copying and pasting your code.

-----------------------------------
evildaddy911
Fri Mar 16, 2012 1:22 pm

Re: is there a way to find out if &quot;offscreenonly&quot; is enabled?
-----------------------------------
alright, i tried the hidden window thing sdreadnought (?) mentioned, is there anything you guys can find wrong with it?
PS
the drawfillbox (0, 0, maxx, maxy, 0)
line in the example is just to show that the reset color procedure works
