Jump to content

2D feature request


Rick
 Share

Recommended Posts

Could we get a 2D drawing function that gets called automatically from the engine/editor? This should be pretty easy to do I would think. It's just like Update(), but this would be right before the Flip() method. It would work just like the other functions in that if it doesn't exist for an object it just doesn't get called. This would allow us to make 2D objects that people could plug-n-play via the editor that would provide huds and gui controls. I think this would go well with the new single state model as other objects would probably require data and feed data to these. I know a possible solution currently would be to do something like billboards but it would be nice to have this option also.

Link to comment
Share on other sites

I too consider that Lua it is possible to make anything you like. But if Lua it is integrated for users not the programmers that such things as HUD, the scenes manager and other base functions are characteristic for all games It is necessary to integrate in Lua, instead of to write them in the form of a script. I understand that Josh all it will not make one, but all I hope that such possibility will appear.

 

I apologise for bad English, thanks.

characters artist

animator

environment artist

vehicles artist

vehicles script writer

 

Participated in ready game projects:

Russian http://4x4game.ru/

English http://www.1cpublishing.eu/game/4x4-hummer/overview

Link to comment
Share on other sites

getting close to having something like this right now...

 

 

Yeah but from your posts you are making this in the fpscontroller script because currently that's the only way you can draw 2D. The switch should be able to handle that all inclusively.

 

I think that would mean that in it's Update() is has it's own picking instead of being just one picking in the main loop so not sure if that would kill performance if enough entities did their own picking inside their Update(). If it does kill performance, then per entity stuff like this could be a pain and not really drop and drag and use.

Link to comment
Share on other sites

The switch should be able to handle that all inclusively.

So true.

 

Another thing that would be great to use this with is placeable Volume lights. This way you can place several billboars on screen creating volume light and you have more controll over it.

 

 

 

on 3:30 in this movie you see how this works. You have to freeze there though because it goes really fast.

Link to comment
Share on other sites

This is exactly what you would use a hook system for...

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

Yeah but from your posts you are making this in the fpscontroller script because currently that's the only way you can draw 2D. The switch should be able to handle that all inclusively.

 

well right now it handles the setting the selectable variable that decides if its going to be shown as well as loading the texture to be used... the fpscontroller script just handles the pick and the drawing... offhand i don't know how useful having a 2d image constantly shown on my screen would be when i am editing a map?

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

getting close to having something like this right now...

Macklebee: Are you able to show the hand icon just on the switch only? I've been strugling with that for a week. I manage to show the image with raycast but I can't make it so, that it only appears on specified objects (like just the switch.)

 

Rick: I tried to make a simple flat plane with a texture and alpha on it, but the effects really ugly. When you stand in the volume ligt you are sort of in the plane and you will see the the edge of the plane going through your screen.

Link to comment
Share on other sites

Macklebee: Are you able to show the hand icon just on the switch only? I've been strugling with that for a week. I manage to show the image with raycast but I can't make it so, that it only appears on specified objects (like just the switch.

 

i have only been messing with it since last night really but thats where i am stuck at the moment... once i have that same key on another model its just looks at the first model that it comes across with that key and goes no further... so at the moment this key/value is particular to this model...

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

well right now it handles the setting the selectable variable that decides if its going to be shown as well as loading the texture to be used... the fpscontroller script just handles the pick and the drawing... offhand i don't know how useful having a 2d image constantly shown on my screen would be when i am editing a map?

 

 

I agree which is why I created a way to tell if I'm running in the editor or from the game script. This would probably be helpful if Josh included something like this by default.

Link to comment
Share on other sites

i have only been messing with it since last night really but thats where i am stuck at the moment... once i have that same key on another model its just looks at the first model that it comes across with that key and goes no further... so at the moment this key/value is particular to this model...

The problem is (I think) that the key doesn't refresh as it is in the loop. I build a menu to check if you want an icon to appear. however when you set a key, you don't check wether the value in the menu is true or false. I used this approach (with a lot of help from Rick).

 

switch.lua :

 

fpscontroller.lua:

--check hand icon
	pick=CameraPick(camera,Vec3(GraphicsWidth()/2,GraphicsHeight()/2,2.0),0,0)
	if pick~=nil then
		-- show hand icon
		if (GetEntityKey(pick.entity,"showhand","yes")==true) then
			handIcon = true
		end
	else
	handIcon = false
	end

 

 

But it's not working correctly. Sometimes it works but not always.

Link to comment
Share on other sites

yes, i have a selectable boolean property as well inside the switch to determine whether to show it or not... also i am doing the loading of the texture with the switch so its loaded with the model

 

and I am also doing a entitydistance check as well in the fpscontroller script. what i have right now is very consistent with one model type... meaning i can have several instances of the same model and it works just fine, but add the same key to a different model and it fails to work for both models...

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

yes, i have a selectable boolean property as well inside the switch to determine whether to show it or not... also i am doing the loading of the texture with the switch so its loaded with the model

 

and I am also doing a entitydistance check as well in the fpscontroller script. what i have right now is very consistent with one model type... meaning i can have several instances of the same model and it works just fine, but add the same key to a different model and it fails to work for both models...

can you show what you have? I'm interested in how much it differs from what I have. perhaps this way I can find something that solves the problem.

Link to comment
Share on other sites

can you show what you have? I'm interested in how much it differs from what I have. perhaps this way I can find something that solves the problem.

 

yes lets do it over a pm so we don't fill up a post with our conversation...

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...