Re: [racket-users] How to draw relative to screen size using worlds?

2017-11-07 Thread Luis Sanjuán
Nice! Thanks for taking the argument seriously and implementing this so quickly.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] How to draw relative to screen size using worlds?

2017-11-07 Thread Luis Sanjuán
Conflicts may arise between 2htdp packages and racket/gui. If you still want to 
stick to 2htdp awesome libraries you may try to require only what you need. But 
this would force you to use racket/base instead of *SL, if only because you 
also need to use `require` options not available in *SL as well as 
`define-values` to retrieve what `get-display-size` produces. Maybe something 
like this:

#lang racket/base
(require 2htdp/image)
(require 2htdp/universe)
(require lang/posn) ; also needed if you are going to use place-images
(require (only-in racket/gui/base get-display-size))

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] How to draw relative to screen size using worlds?

2017-11-07 Thread Milton Silva
get-display-size does what I want but trying to draw a rectangle with (
rectangle 

 
w h "solid" "black") renders a black screen with the top and left borders 
white. I tried to position the rectangle(with place-image and a few 
other)... then I gave up and started using racket/gui. It works great. 
Thank you for the help.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] How to draw relative to screen size using worlds?

2017-11-06 Thread Luis Sanjuán
Hi, Matthias. I'm not sure about it either, but one situation where learners or 
users might miss it is when they want to share their work. If their code 
follows the design principles HtDP teaches, the world rendering will rely on a 
single point of control, say the width and/or height of the scene. But those 
are ultimately bound to the particular size of the computer screen on which 
they coded. On the other hand, if they were able to set the relative display 
size as point of control, well written code will behave well on many different 
screens, while not so good code would be penalized when shared. Just a point to 
speak in favor of the inclusion, but there might be more solid reasons to 
reject it.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] How to draw relative to screen size using worlds?

2017-11-06 Thread Matthias Felleisen

> On Nov 6, 2017, at 5:51 AM, Milton Silva  wrote:
> 
> Assuming that the big-bang needs to run on different sized screens and using 
> fullscreen mode in big-bang, how can I draw a shape(e.g. rectangle) that 
> occupies a percentage of the fullscreen?


I don’t think you can currently get the extent of the canvas (or screen). Since 
this is not part of any pedagogical use, I didn’t think of it and honestly I am 
not sure of including this kind of twist. 

If you want to propose a tasteful PR, I’ll inspect it. 

— Matthias

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] How to draw relative to screen size using worlds?

2017-11-06 Thread Luis Sanjuán
You probably need to get the dimensions of the screen with get-display-size 
from racket/gui 

It would be great to have primitives for that in 2htdp/universe.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] How to draw relative to screen size using worlds?

2017-11-06 Thread Milton Silva
Assuming that the big-bang needs to run on different sized screens and using 
fullscreen mode in big-bang, how can I draw a shape(e.g. rectangle) that 
occupies a percentage of the fullscreen?

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.