Jump to content

[SOLVED] Create a logo for the screen


Otto

Recommended Posts

Ok, I think most of the people here has played on DKR, or checked out it. (Sorry for bad english)

What I mean here is that, I wanna make a logo on some corner of the screen, that appears all the time since you connect, up you disconnect.

I'll do the image, based on the DKR one:

dkrlogo.png

I think you have seen it.

How can I script something for showing this logo? (The one I'll photoshop with the same sizes).

Edited by Guest
Link to comment
What you don't understand? is really easy to create a simple logo in the screen.

It's probably one of the simplest scripting tasks, as far as I know.

The easiest is creating announces in the chat xD

BTW, Castillo, it's "What DON'T YOU", not "what you don't".

Link to comment
Ok, I think most of the people here has played on DKR, or checked out it. (Sorry for bad english)

What I mean here is that, I wanna make a logo on some corner of the screen, that appears all the time since you connect, up you disconnect.

I'll do the image, based on the DKR one:

dkrlogo.png

I think you have seen it.

How can I script something for showing this logo? (The one I'll photoshop with the same sizes).

Wiki, start with basics first.

Link to comment
-.-

addEventHandler( "onClientRender", getLocalPlayer(),

function()

dxDrawImage( ... )

end )

Thats all. ( Do it for ur self. it is only the syntax. )

Easier.

Just add this code to any client script:

sw, sh = guiGetScreenSize ( ) 
width, height = guiGetSize ( IMAGEPATH ) --IMAGEPATH is the path of the logo (e.g. "logo.png") 
guiCreateStaticImage ( sw - ( width / 2 ), sh - ( height / 2 ) , width, height, false ) 

and create a meta.xml that includes that file.

Link to comment

Let me see:

sw, sh = guiGetScreenSize ( ) 
width, height = guiGetSize ( fgislogo.png ) 
guiCreateStaticImage ( sw - ( width / 2 ), sh - ( height / 2 ) , width, height, false ) 
function checkResolutionOnStart ( theResource ) 
    if theResource ~= getThisResource() then return end 
    local x,y = guiGetScreenSize() 
    if ( x <= 640 ) and ( y <= 480 ) then 
        outputChatBox ( "Wait! You are running this game with a low resolution. Some things would not appear on your screen. Turn resolution more than 640x480 if you can." ) 
    end 
end 
addEventHandler ( "onClientResourceStart", getRootElement(), checkResolutionOnStart ) 

Something like that?

Link to comment
"width, height = guiGetSize ( fgislogo.png )" ? what is that? you can't get the size from a image file.. you need a valid GUI element.
sw, sh = guiGetScreenSize ( ) 
width, height = guiGetSize ( theElement ) 
guiCreateStaticImage ( sw - ( width / 2 ), sh - ( height / 2 ) , width, height, false ) 
function checkResolutionOnStart ( theResource ) 
    if theResource ~= getThisResource() then return end 
    local x,y = guiGetScreenSize() 
    if ( x <= 640 ) and ( y <= 480 ) then 
        outputChatBox ( "Wait! You are running this game with a low resolution. Some things would not appear on your screen. Turn resolution more than 640x480 if you can." ) 
    end 
end 
addEventHandler ( "onClientResourceStart", getRootElement(), checkResolutionOnStart ) 

Like.. Have you got Skype?

So I changed it to "theElement". How can the program know that "theElement" is "fgislogo.png" ?

Link to comment

It can't detect because is not a ELEMENT! try something like this:

local sw, sh = guiGetScreenSize ( ) 
local width, height = 20, 30 
guiCreateStaticImage ( sw - ( width / 2 ), sh - ( height / 2 ) , width, height, "fgislogo.png", false ) 
function checkResolutionOnStart ( theResource ) 
    if theResource ~= getThisResource() then return end 
    local x,y = guiGetScreenSize() 
    if ( x <= 640 ) and ( y <= 480 ) then 
        outputChatBox ( "Wait! You are running this game with a low resolution. Some things would not appear on your screen. Turn resolution more than 640x480 if you can." ) 
    end 
end 
addEventHandler ( "onClientResourceStart", getRootElement(), checkResolutionOnStart ) 

the width and height had to be configured by yourself.

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