Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

How is this ‘codeaimage’?

in Questions Posts: 774
    local function s(data)
        local img = {}
        for x = 1, horiAmount do
            img[x] = {}
            for y = 1, vertAmount do
                local w, h = math.floor(data.width/horiAmount), math.floor(data.height/vertAmount)
                img[x][y] = data:copy((x-1)*w, (y-1)*h, w, h)
            end
        end
        Server.UI.List["image." .. name] = img
        print("Server > Object '" .. name .. "' found!")
        Server.MessToClient("ui", "img", name, data)
    end

Example Image: i.imgur.com/vaB06KX.png (attached, too)

My logic is the following:

- Create a table ‘img’
- Store inside the table ‘img’ table to hold values for ‘x’
- Store there copied parts of the image.
I expect: ‘img’ has all the images stored.

What I don’t get:

‘img’ is used to be return as ‘codeaimage’, and not as ‘table’

Comments

  • dave1707dave1707 Mod
    Posts: 6,828

    @TokOut Are you trying to copy each of those 12 images from the single image and put them in a table as 12 seperate images.

  • Posts: 774

    Yes, @dave1707, that’s my logic.

  • Posts: 774

    Oh excuse me, I am wrong. Please close this and do not respond.

  • edited June 10 Posts: 774

    **The Problem was: ** The y is the topmost pixel of the image, not the bottommost

This discussion has been closed.