Jump to content

How to?


Recommended Posts

Hi :D, here is a script that i got from solidsnake14. The script is good for putting one picture somewhere. For placing multiple pictures, this rescource is good.

Heres the script :)

Script:

local distance = 70 
local screenSizeX, screenSizeY = guiGetScreenSize() 
local scale = 7 
local myImage = "mtalogo.png" 
local x, y, z = 0, 0, 5 
  
function renderImage() 
    local px, py, pz = getElementPosition ( localPlayer ) 
    local dist = getDistanceBetweenPoints3D ( px, py, pz, x, y, z ) 
    if (dist < distance and isLineOfSightClear( px, py, pz, x, y, z, true, false, false, false )) then 
        local screenX, screenY = getScreenFromWorldPosition ( x, y, z+0.5 ) 
        local scaled = screenSizeX * (1/(2*(dist+5))) *.85 
        local relX, relY = scaled * scale, scaled * scale 
        if ( screenX and screenY ) then 
            dxDrawImage( screenX, screenY, relX, relY, tostring(myImage) ) 
        end 
    end 
end 
addEventHandler( "onClientRender", root, renderImage ) 

If you need any extra help setting up the scripts, just ask :D

Link to comment
Hi :D, here is a script that i got from solidsnake14. The script is good for putting one picture somewhere. For placing multiple pictures, this rescource is good.

Heres the script :)

Script:

local distance = 70 
local screenSizeX, screenSizeY = guiGetScreenSize() 
local scale = 7 
local myImage = "mtalogo.png" 
local x, y, z = 0, 0, 5 
  
function renderImage() 
    local px, py, pz = getElementPosition ( localPlayer ) 
    local dist = getDistanceBetweenPoints3D ( px, py, pz, x, y, z ) 
    if (dist < distance and isLineOfSightClear( px, py, pz, x, y, z, true, false, false, false )) then 
        local screenX, screenY = getScreenFromWorldPosition ( x, y, z+0.5 ) 
        local scaled = screenSizeX * (1/(2*(dist+5))) *.85 
        local relX, relY = scaled * scale, scaled * scale 
        if ( screenX and screenY ) then 
            dxDrawImage( screenX, screenY, relX, relY, tostring(myImage) ) 
        end 
    end 
end 
addEventHandler( "onClientRender", root, renderImage ) 

If you need any extra help setting up the scripts, just ask :D

This script doesn't "put pictures somewhere", what this code actually does is draw an image near each player. It has nothing to do with what the TO said.

Link to comment

oh, sorry,

ok, images could look different for anyone, so if it looks HD for you then it might not look HD for others, because of many reasons.

1. Their resolution might be lower than their actual screen resolution

2. Image might look smaller/larger

etc.... ect....

but the only thing I could tell you to do, is edit the image(if you are good at art).

Link to comment
NO you are all wrong. I am not trying to make the picture bigger, all I want to do Is to design a hd-rendering script. (For Images)

I asked long time ago how could I do this but actually the problem was with my crap laptop that could not render a picture with decent quality and so others didn't see it with good quality too.

But I can tell you ( Aibo told me ), if you want better quality, use power 2 resolutions, like: 128x128, 128x64, 128x32, 256x256, 512x512, etc.

Link to comment

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...