Forum

> > CS2D > Scripts > [Menu] Type's
Forums overviewCS2D overview Scripts overviewLog in to reply

English [Menu] Type's

14 replies
To the start Previous 1 Next To the start

old Re: [Menu] Type's

Happy eyes
User Off Offline

Quote
You need a blank image of that sub menu, then you have to add image every time when player opens menu, and delete image when player closes menu (use HUD mode on image).
Also you need to do same with hudtxt lines, to add text (add text when menu is opened, and delete text when menu is closed) Commands you will need is cs2d lua cmd image and cs2d cmd hudtxt

old Re: [Menu] Type's

Suprise
BANNED Off Offline

Quote
I have one. If you need it, use it.
IMG:https://i30.servimg.com/u/f30/17/30/54/57/start_10.jpg

I created this for my mod, but since I can't use image correctly, I don't need it.

old Re: [Menu] Type's

Avo
User Off Offline

Quote
@user Jhony: use image function and hudtxt command to write text over it. And advice for the future: do not comment files like "0/-0" .

old Re: [Menu] Type's

Suprise
BANNED Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
function Array(size,value)
	local array = {}
	for i = 1, size do
		array[i] = value
	end
	return array
end

news_image = Array(32,0)

imagepath = "gfx/start" -- Your image! 

locked={}
	
addhook("serveraction","_action")
function _action(id,action)
	if action == 1 then
		if locked[id]==true then
			menu(id,"Player menu,(News),News off")
		else
			menu(id,"Player menu,News,(News off)")
		end
	end
end

addhook("menu","_menu")
function _menu(id,title,button)
	if title == "Player menu" then
		if button == 1 then
			if locked[id]==nil or locked[id]==false then
				locked[id]=true
				news_image[id] = image(imagepath..".bmp",440,80,2,source)
				parse('hudtxt2 '..id..' 1 "©255255255Today news!" 400 23') --Add more texts! This show only the title! If you need help with it PM me.
			end
		elseif button == 2 then
			if locked[id]==true then
				locked[id]=false
				freeimage(news_image[id])
				parse('hudtxt2 '..id..' 1 "" 400 23')
			end
		end
	end
end

old Re: [Menu] Type's

Jhony
User Off Offline

Quote
Ok '-'
But How to Position Images and Texts, Do not Know the Numbers of Positions
I want to learn the positions of images and texts

old Re: [Menu] Type's

Gaios
Reviewer Off Offline

Quote
user Jhony has written
Ok '-'
But How to Position Images and Texts, Do not Know the Numbers of Positions
I want to learn the positions of images and texts


You must change script, line:
1
2
news_image[id] = image(imagepath..".bmp",440,80,2,source)
parse('hudtxt2 '..id..' 1 "©255255255Today news!" 400 23') --Add more texts!
Change:
440 80 x and y image
400 23 x and y text

old Re: [Menu] Type's

Jhony
User Off Offline

Quote
@user Gaios: I Want to Learn them Positions
Example: Putting the picture in Half
Example: Putting the picture below

I do not know the Codes of Positions
There is a Tutorial Showing them?

old Re: [Menu] Type's

Gaios
Reviewer Off Offline

Quote
Spoiler >


not understand.
Screen in cs2d 640x480
center in cs2d 320x240
ok?

old Re: [Menu] Type's

Jhony
User Off Offline

Quote
user Gaios has written
Spoiler >


not understand.
Screen in cs2d 640x480
center in cs2d 320x240
ok?


wtf??

What Hell is that?
So I want to Learn Numbers of Positions
Example: Placing Images below (Number of Position? <- Example)

old Re: [Menu] Type's

Eternal
User Off Offline

Quote
@user Jhony: You mean X , Y position or what i don't understand and don't often use the capital letters.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview