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: 795
    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)
        Server.UI.List["image." .. name] = img
        print("Server > Object '" .. name .. "' found!")
        Server.MessToClient("ui", "img", name, data)

Example Image: (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’


  • dave1707dave1707 Mod
    Posts: 6,929

    @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: 795

    Yes, @dave1707, that’s my logic.

  • Posts: 795

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

  • edited June 10 Posts: 795

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

This discussion has been closed.