palette stuff again

new topic     » topic index » view thread      » older message » newer message

David,
I tried your convertToPalette () function and I couldn't get it to work
the way that I wanted. I changed my function to call yours and actually
change the picture to use the standard palette. Here's what I'm doing;
tell me if I'm totally doing something wrong or if this just doesnt work
in graphics_mode (18).


global function new_pal (sequence pal_n_pic)
-- this function makes a bitmap work with the standard palette
-- call this function BEFORE you call all_palette
    object index, pic
    pic = pal_n_pic [2]
    index = convertToPalette (pal_n_pic [1])
    -- giving visual aid to what's happening
    position (1,1)
    puts (1, "Converting bitmap to normal palette:\n[" &
        repeat (' ', length(pic [1])+1) & "]")
    position (2,2)
    for x = 1 to length (pic) do
        if integer (x) then puts (1, "#") end if
        for y = 1 to length (pic [x]) do
            pic [x] [y] = find (pic [x] [y], index) -1
        end for
    end for
    puts (1, "\n Complete, thank you for waiting")
    return {get_all_palette (), pic}
end function

TIA
Lewis Townsend

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu