I am trying to use this code, but its a little off.
I want the entire object to be covered over by the sprite.
Any help? Thanks!
SetErrorMode(2)
SetVSync(1)
// set window properties
SetWindowTitle( "test" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
door2txt = LoadImage("/media/assets.png")
dr = LoadObject("/media/farm_props.obj")
SetObjectImage( dr, door2txt, 0 )
SetCameraPosition( 1, GetObjectX( dr ), GetObjectY( dr ), GetObjectZ( dr ) )
MoveCameraLocalZ( 1, -.25 )
MoveCameraLocalY( 1, 5.5 )
SetCameraLookAt( 1, GetObjectX( dr ), GetObjectY( dr ), GetObjectZ( dr ), 0 )
png = LoadSprite( "/media/lightyellow.png" )
sy1# = GetScreenYFrom3D( getobjectx(dr)+GetObjectSizeMinX(dr), getobjecty(dr)+GetObjectSizeMinY(dr), getobjectz(dr)+GetObjectSizeMinZ(dr) )
sy2# = GetScreenYFrom3D( getobjectx(dr)+GetObjectSizeMaxX(dr), getobjecty(dr)+GetObjectSizeMaxY(dr), getobjectz(dr)+GetObjectSizeMaxZ(dr) )
sx1# = GetScreenXFrom3D( getobjectx(dr)+GetObjectSizeMinX(dr), getobjecty(dr)+GetObjectSizeMinY(dr), getobjectz(dr)+GetObjectSizeMinZ(dr) )
sx2# = GetScreenXFrom3D( getobjectx(dr)+GetObjectSizeMaxX(dr), getobjecty(dr)+GetObjectSizeMaxY(dr), getobjectz(dr)+GetObjectSizeMaxZ(dr) )
x# = abs(sx1#-sx2#)
y# = abs(sy1#-sy2#)
SetSpriteSize( png, x#, y# )
SetSpriteColorAlpha( png, 125 )
sx# = GetScreenXFrom3D( getobjectx(dr), getobjecty(dr), getobjectz(dr) )
sy# = GetScreenYFrom3D( getobjectx(dr), getobjecty(dr), getobjectz(dr) )
SetSpritePositionByOffset( png, sx#, sy# )
do
print(GetRawMouseX())
print(GetRawMouseY())
print(x#)
print(y#)
print(sy1#)
print(sy2#)
sync()
loop