Jump to content

Object Preview


TorNix~|nR

Recommended Posts

I used this resource ( object_preview ), the ped is showed but when I save it on png, it saves but saves empty

this is the resource on community https://community.multitheftauto.com/index.php?p=resources&s=details&id=11836

any help please? this is the code

local x, y, z = getCameraMatrix()
    local sx, sy = guiGetSize(GUIEditor.staticimage[1], false)
    local skin = createPed(getElementModel(localPlayer), x, y, z)
    local view = exports.object_preview:createObjectPreview(skin, 0, 0, 200, 0, 0, sx, sy, false, false, true)
    exports.object_preview:saveRTToFile(view, "gui_skin.png") 
    exports.object_preview:destroyObjectPreview(view)
    destroyElement(skin)

    guiStaticImageLoadImage(GUIEditor.staticimage[1], "gui_skin.png")

 

Link to comment

Thank you it's working, but when I open the panel, every 50 milliseconds the ped automatically disappear, this is the problem

you can see the image, it appears and suddenly disappears every time I open the panel

Code:

 

local x, y, z = getCameraMatrix()
    local sx, sy = guiGetSize(GUIEditor.staticimage[1], false)
    local skin = createPed(getElementModel(localPlayer), x, y, z)
    local view = exports.object_preview:createObjectPreview(skin, 0, 0, 200, 0, 0, sx, sy, false, false, true)
    setTimer(function ( )
    	exports.object_preview:saveRTToFile(view, "gui_skin.png") 
        guiStaticImageLoadImage(GUIEditor.staticimage[1], "gui_skin.png")
    	exports.object_preview:destroyObjectPreview(view)
    	destroyElement(skin)
    end, 50, 1)

Image:

wS0y2LH.jpg

Link to comment
  • 1 year later...
  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...