1. Re: new truecolor library
Mark Smith wrote:
>
> I'm a one week newbie on Euphoria so I may be running ahead of myself
> but I am having trouble getting the truecolor library to work. I've run
> the trutwnkl.ex demo and that seems to work with random coloured dots
> appearing on the screen. I've also installed the updated truecolr.ex
> and run the setup ex to run in 640 x 480.
good! that's a very good start considering all but this last
version had bugs :)
> I thought I would try my own code but what appears on the screen isn't
> what I would expect. The code is:-
> ----------code begin------------
> include truecolr.e
> atom delay
>
> InitDisplay()
> --let the display "settle" from the mode switch
> delay = time() + 0.7 --seconds
> while time()<delay do
> --some yawning, stretching, scratching... etc...
> end while
in the latest version, i added that code to initdisplay,
for the 'settle', so you no longer need it... it helps a lot too...
> true_circle({200,200}, 1, {255,255,255})
that is a 1 unit radius, ergo a single pixel
truecircle({200,200},50,trueblue)
thats a little bigger (50 unit) :)
> true_pixel({100,100},{255,255,255})
that is a single pixel plotted at 100,100 in the color white
to plot more than one pixel with truepixel, use a longer
bgr sequence:
that plots 3 points, from 100,100 to 103,100, respective colors.
> true_line(150,300,100,150,TrueBlue)
that is the diagonal dots you see (a diagonal line from:
150,300 to 100,150 in the color trueblue
> What I get on the screen for the circle and the line are diagonal dots
> placed across the screen not a circle or a line.
i ran the above code, too, btw, in the latest version and it
ran like a champ...
>This also applied with code I used for the filled box.
lets see the code??? hard to talk about it with out it :)
>I assume the origin {0,0} is the top
> left corner because if it is the true_pixel code
it is... and you have a constant defined as ORIGIN,
which helps for page flipping virtual screens using
the command set_virtual_screen(ORIGIN,{},VirtScr)...
simple... no? :)
lets break that one down:
firstparameter:ORIGIN = where to begin placing
second:{} = how much of the virtual screen to place
the {} signifies *all* of that screen.
suppose you had done this prior to that:
VirtScr = make_virtual_screen(SCR_WIDTH,SCR_HEIGHT,TrueBlack)
well now you have a virtual screen that is exactly
the same size as your current video mode, and that is
always kept updated, even if you switch modes, those
two constants are always right (but no, i don't go
through all previously made virtual screens and scale
them) and it has been 'cleared' by the optional third
parameter TrueBlack.
now draw something to VirtScr, loop (mebbe check for
fire button pressed) and set VirtScr back down
newly updated...
at 640x480 you get 10-30fps full screen flipping,
and even at 10 it's still smooth... on my p200mmx
at 800x600 i can often get 18-24 fps full screen flipping...
it is faster now than ever :)
>didn't seem to work as it placed the pixel way over
>on the right of the screen.
once again... lets see the code? you may have a typo
or sumfin...
>I've also run
> Irv Mullins code which produced diagonal lines
>for the boxes and a
> screen of lots of closely packed lines for the clouds.bmp.
that has been fixed, but the boxes shoulda been right, the
bmp routine was wrong tho... try it again with this lastest
version (11.6.98)
sorry for any trouble your having...
in a few hours, mebbe a day or so, rob will have the
newest version on the eu main page, as well as i'm posting
it here attached and zipped, so snag that as soon
as you can, then hang tight cuz i've got a real
big, thorough demo program that shows off nearly
every feature of all three libraries at once...
take care--hawke'