Loading ...
Sorry, an error occurred while loading the content.
 

Raised button/tile in vision2

Expand Messages
  • Jimmy Johnson
    Is there a way to draw a button that appears raised, like a game tile on a game board in Vision2? I want to draw this widget in a EV_FIGURE_WORLD and add
    Message 1 of 3 , Oct 8, 2011
      Is there a way to draw a "button" that appears raised, like a game tile on a game board in Vision2? I want to draw this widget in a EV_FIGURE_WORLD and add numbers and pixmaps to it.
    • Emmanuel Stapf [ES]
      Nothings prevents you from creating your own figure and define your own drawing routine. Manu
      Message 2 of 3 , Oct 12, 2011
        Nothings prevents you from creating your own figure and define your own drawing
        routine.

        Manu

        > -----Original Message-----
        > From: eiffel_software@yahoogroups.com
        > [mailto:eiffel_software@yahoogroups.com] On Behalf Of Jimmy Johnson
        > Sent: Saturday, October 08, 2011 2:36 PM
        > To: eiffel_software@yahoogroups.com
        > Subject: [eiffel_software] Raised button/tile in vision2
        >
        > Is there a way to draw a "button" that appears raised, like a game tile
        > on a game board in Vision2? I want to draw this widget in a
        > EV_FIGURE_WORLD and add numbers and pixmaps to it.
        >
        >
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
      • finnian@eiffel-loop.com
        Hi Jimmy a few years ago I had a similar requirement to create a raised tile effect. I achieved it with the code below. Good luck Finnian draw_raised_square
        Message 3 of 3 , Oct 14, 2011
          Hi Jimmy
          a few years ago I had a similar requirement to create a raised tile effect. I achieved it with the code below.
          Good luck
          Finnian

          draw_raised_square (x, y, square_width: INTEGER) is

          --

          local

          l_x, l_y: INTEGER

          do

          l_x := x - square_width // 2 - 1

          l_y := y + square_width // 2

          fill_rectangle (l_x, l_y, square_width, square_width)

          draw_raised_square_shadow (l_x, l_y, square_width)

          end



          draw_raised_square_shadow (x, y, square_width: INTEGER) is

          --

          do

          set_foreground_color (stock_colors.white)

          set_line_width (1)

          draw_segment (x, y, x, y - (square_width - 1))

          draw_segment (

          x , y , x + (square_width - 1), y

          )

          set_foreground_color (stock_colors.black)

          draw_segment (x + square_width , y - 1, x + square_width, y - square_width)

          draw_segment (

          x + 1 , y - square_width , x + square_width , y - square_width

          )

          end
        Your message has been successfully submitted and would be delivered to recipients shortly.