1. TEXT IN SHADO

Hi,
In text mode it's often smarter to present messages or menus in
a box, and given it a 3D look, casting a shadow on 2 sides.
I notice though that in some software the back text in the shadow
remain still visible  like in reality.
How can I do that in Euphoria ? I found mention of this no where
in basic or pascal. Thanks for any help.
-- Jean.Hendrickx. j.hendrickx at infoboard.be

new topic     » topic index » view message » categorize

2. Re: TEXT IN SHADO

> Hi,
> In text mode it's often smarter to present messages or menus in
> a box, and given it a 3D look, casting a shadow on 2 sides.
> I notice though that in some software the back text in the shadow
> remain still visible  like in reality.
> How can I do that in Euphoria ? I found mention of this no where
> in basic or pascal. Thanks for any help.

It's quite simple.... All the area that is supposed to be "shadowed"
has a darker background and foreground. In Euphoria you achieve this
with the functions text_color() and bk_color()  (see Euphoria library
reference for more details).

Regards,
  Daniel Berstein
  danielberstein at usa.net
  http://www.geocities.com/SiliconValley/Heights/9316

new topic     » goto parent     » topic index » view message » categorize

3. Re: TEXT IN SHADO

On Sat, 16 Aug 1997 17:07:17 +0100 Jean Hendrickx
<jean.hendrickx at EURONET.BE> writes:
>In text mode it's often smarter to present messages or menus in
>a box, and given it a 3D look, casting a shadow on 2 sides.
>I notice though that in some software the back text in the shadow
>remain still visible  like in reality.
>How can I do that in Euphoria ? I found mention of this no where
>in basic or pascal. Thanks for any help.

There was one thing I saw in QBasic that used PEEK and POKE, but there
was a lot of code for it... It is called Shadow Box... I don't have it
anymore...
Anyway, another approach is find out what character is on the screen
where each part of the shadow is, use a black background, and a darker
color. (If the color is >=9 then color = color - 8... color 7 (white) = 8
(gray).)
Colors 8-15 are brights. (8 is bright black, or gray... I said 9-15
because you may not want gray to become black... if so then make it if
color >= 8...

new topic     » goto parent     » topic index » view message » categorize

4. TEXT IN SHADO

The 17/08/97 Daniel Berstein wrote :
 In text mode it's often smarter to present messages or menus in
 a box, and given it a 3D look, casting a shadow on 2 sides.
 I notice though that in some software the back text in the shadow
 remain still visible  like in reality.
 How can I do that in Euphoria ? I found mention of this no where
 in basic or pascal. Thanks for any help.
> It's quite simple.... All the area that is supposed to be "shadowed"
> has a darker background and foreground. In Euphoria you achieve this
> with the functions text_color() and bk_color()  (see Euphoria library
> reference for more details).
Hi Daniel,
May be I explained clumsily. Please try the following routine :
-- BEGIN CODE ----
-- BOX.EX shadowed box on the screen .. J. Hendrickx 18/08/97
include graphics.e
global procedure Box(integer rl, integer cl, integer long, integer width,
integer charbk, integer colbk, integer colchar, integer shad)
-- rl = row left corner  cl= column left corner
-- long= length (horizontal) of the box width= width (vertical) of the box
-- charbk= character to fill the box (usually ' '= 32; 176)
-- colbk= color of the background in the box
-- colchar= color of text (in case charbk != 32)
-- shad : 1= shadowed box, 0= no shadow.
sequence Fill
text_color(colchar) bk_color(colbk)
position(rl,cl)
for i=rl  to rl+width do
Fill= repeat(charbk,long)
    position(i,cl) puts(1,Fill)
end for
if shad=1 then
   bk_color(BLACK)
   Fill=repeat(32,long-1)
   position(rl+width+1,cl+2) puts(1,Fill)
   for i=rl+1  to rl+width+1 do
    position(i,cl+long) puts(1,32 & 32)
   end for
end if
end procedure
--
bk_color(BLUE) clear_screen()
for i = 1 to 174 do
    puts(1,"abracadabra")
end for
Box(12,20,15,3,32,WHITE,BLACK,1)
bk_color(WHITE) text_color(RED)
position(13,21) puts(1,"Hello World !")
-- END CODE ----
You'll notice that the shadow wipe out the text. In some software, the
text remain still visible but shadowed. That's the trick I wish to know.
Regards,
-- Jean.Hendrickx. j.hendrickx at infoboard.be

new topic     » goto parent     » topic index » view message » categorize

5. Re: TEXT IN SHADO

On 18 Aug 97 , Jean Hendrickx wrote:

> Hi Daniel,
 ... code trimmed 8<  ...

> You'll notice that the shadow wipe out the text. In some software, the
> text remain still visible but shadowed. That's the trick I wish to know.

Hi Jean, I made mayor surgey to your code... the result is following
this words... Is this what you wanted?

-- BEGIN CODE ----
-- SHADOWBOX.EX shadowed box on the screen
-- Modified (improved?) version by Daniel Berstein of J. Hendrickx
code.

include graphics.e
include image.e

global procedure ShadowBox(sequence ul, sequence lr, integer bcol,
integer sfr,
  integer sbg)
    -- ul   = Upper left corner of box {row, column}
    -- lr   = Lower left corner of box {row, column}
    -- bcol = Color of box
    -- sfr  = Foreground color of shadow
    -- sbg  = Background color of shadow
    sequence aux
    -- Draw box
    bk_color(bcol)
    aux = repeat(32,lr[2]-ul[2])
    for i=ul[1] to lr[1] do
 position(i,ul[2])
 puts(1,aux)
    end for
    -- Draw shadow to the left and below of box
    text_color(sfr)
    bk_color(sbg)
    -- Draw vertical shade
    aux = save_text_image({ul[1]+1,lr[2]},{lr[1],lr[2]})
    for i = 1 to lr[1]-ul[1] do
 position(ul[1]+i,lr[2])
 puts(1,aux[i][1])
    end for
    -- Draw horizontal shade
    aux = save_text_image({lr[1]+1,ul[2]+1},{lr[1]+1,lr[2]+1})
    for i = 0 to (lr[2]-ul[2]-1)*2 by 2 do
 position(lr[1]+1,ul[2]+((i/2)+1))
 puts(1,aux[1][i+1])
    end for
end procedure

-- Test code:
clear_screen()
bk_color(BLUE)
for i = 1 to 181 do
    puts(1,"-ShadowBox-DEMO")
end for
ShadowBox({12,18},{15,37},WHITE,BLUE,BLACK)
bk_color(WHITE)
text_color(RED)
position(13,21) puts(1,"Hello World !")
--- END CODE ----


Regards,
  Daniel Berstein
  danielberstein at usa.net
  http://www.geocities.com/SiliconValley/Heights/9316

new topic     » goto parent     » topic index » view message » categorize

6. TEXT IN SHADO

On 18 Aug 97 , Daniel Berstein wrote:
> Hi Jean, I made mayor surgey to your code... the result is following
> this words... Is this what you wanted?
Hi Daniel,
That is _exactely_ what I wanted, and with a very compact code.
Many, many thanks !
-- Jean.Hendrickx. j.hendrickx at infoboard.be

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu