Jump to content

Adding overlay pictures and annotations using CreateElement ceStringPoly


The LT

Recommended Posts

Hello everyone,

 

I am trying to get into DCS modding and trying to make a simple mod which will display arbitrary textures/images and text strings when a player is sitting in a specific aircraft.

 

This is handy when you have TM Cougar MFDs with displays in them. That way we can have button annotations and have a handy reference of those buttons.

 

I've tried using "ControlsIndicator" implementation as a reference with minimal success. Got the basic grasp for drawing stuff on screen but for some reason, ceStringPoly elements aren't getting created, while ceTexPoly elements are easily created, tweaked and positioned. For some reason, I have no problems drawing ceStringPoly elements in the Mi-8 but they aren't being drawn in the Fw-190A8.

 

What is the correct way of initializing an additional "overlay"? device_init.lua? I've just added another "indicator" reference but I am not sure this is correct.

 

What is the correct syntax of invoking the "ceStringPoly" element?

My controls & seat

 

Main controls: , BRD-N v4 Flightstick (Kreml C5 controller), TM Warthog Throttle (Kreml F3 controller), BRD-F2 Restyling Bf-109 Pedals w. damper, TrackIR5, Gametrix KW-908 (integrated into RAV4 seat)

Stick grips:

Thrustmaster Warthog

Thrustmaster Cougar (x2)

Thrustmaster F-16 FLCS

BRD KG13

 

Standby controls:

BRD-M2 Mi-8 Pedals (Ruddermaster controller)

BRD-N v3 Flightstick w. exch. grip upgrade (Kreml C5 controller)

Thrustmaster Cougar Throttle

Pilot seat

 

 

Link to comment
Share on other sites

Hello everyone,

 

 

 

I am trying to get into DCS modding and trying to make a simple mod which will display arbitrary textures/images and text strings when a player is sitting in a specific aircraft.

 

 

 

This is handy when you have TM Cougar MFDs with displays in them. That way we can have button annotations and have a handy reference of those buttons.

 

 

 

I've tried using "ControlsIndicator" implementation as a reference with minimal success. Got the basic grasp for drawing stuff on screen but for some reason, ceStringPoly elements aren't getting created, while ceTexPoly elements are easily created, tweaked and positioned. For some reason, I have no problems drawing ceStringPoly elements in the Mi-8 but they aren't being drawn in the Fw-190A8.

 

 

 

What is the correct way of initializing an additional "overlay"? device_init.lua? I've just added another "indicator" reference but I am not sure this is correct.

 

 

 

What is the correct syntax of invoking the "ceStringPoly" element?

I've figured it out. Font variables had to be declared. Still not sure about how to add textures/images. 5975c10e85ef71825810f8001a03a9b2.jpg

My controls & seat

 

Main controls: , BRD-N v4 Flightstick (Kreml C5 controller), TM Warthog Throttle (Kreml F3 controller), BRD-F2 Restyling Bf-109 Pedals w. damper, TrackIR5, Gametrix KW-908 (integrated into RAV4 seat)

Stick grips:

Thrustmaster Warthog

Thrustmaster Cougar (x2)

Thrustmaster F-16 FLCS

BRD KG13

 

Standby controls:

BRD-M2 Mi-8 Pedals (Ruddermaster controller)

BRD-N v3 Flightstick w. exch. grip upgrade (Kreml C5 controller)

Thrustmaster Cougar Throttle

Pilot seat

 

 

Link to comment
Share on other sites

local GREEN_TRANSPARENT_COLOR = {0  ,255,0,128} --128,165,0,120
local HUD_BASE_TEXTURE	= MakeMaterial(IndicationTexturesPath.."HUD_base.dds",GREEN_TRANSPARENT_COLOR)

local HUD_base	    = CreateElement "ceTexPoly" --this could be the text area on HUD
HUD_base.name 		= create_guid_string() -- this must be external function call.
HUD_base.vertices   = {{-grid_radius, grid_radius},
				   { grid_radius, grid_radius},
				   { grid_radius,-grid_radius},
				   {-grid_radius,-grid_radius}}
HUD_base.indices		= {0,1,2,2,3,0}
HUD_base.tex_coords		= {{0,0},{1,0},{1,1},{0,1}}
HUD_base.material		= HUD_BASE_TEXTURE	   
HUD_base.init_pos		= {0,0} 
HUD_base.collimated		= true
HUD_base.change_opacity = false
HUD_base.parent_element = grid_origin.name
AddElement(HUD_base)


Link to comment
Share on other sites

  • 2 weeks later...
local GREEN_TRANSPARENT_COLOR = {0  ,255,0,128} --128,165,0,120
local HUD_BASE_TEXTURE	= MakeMaterial(IndicationTexturesPath.."HUD_base.dds",GREEN_TRANSPARENT_COLOR)

local HUD_base	    = CreateElement "ceTexPoly" --this could be the text area on HUD
HUD_base.name 		= create_guid_string() -- this must be external function call.
HUD_base.vertices   = {{-grid_radius, grid_radius},
				   { grid_radius, grid_radius},
				   { grid_radius,-grid_radius},
				   {-grid_radius,-grid_radius}}
HUD_base.indices		= {0,1,2,2,3,0}
HUD_base.tex_coords		= {{0,0},{1,0},{1,1},{0,1}}
HUD_base.material		= HUD_BASE_TEXTURE	   
HUD_base.init_pos		= {0,0} 
HUD_base.collimated		= true
HUD_base.change_opacity = false
HUD_base.parent_element = grid_origin.name
AddElement(HUD_base)


 

Спасибо, попробую через материал.

My controls & seat

 

Main controls: , BRD-N v4 Flightstick (Kreml C5 controller), TM Warthog Throttle (Kreml F3 controller), BRD-F2 Restyling Bf-109 Pedals w. damper, TrackIR5, Gametrix KW-908 (integrated into RAV4 seat)

Stick grips:

Thrustmaster Warthog

Thrustmaster Cougar (x2)

Thrustmaster F-16 FLCS

BRD KG13

 

Standby controls:

BRD-M2 Mi-8 Pedals (Ruddermaster controller)

BRD-N v3 Flightstick w. exch. grip upgrade (Kreml C5 controller)

Thrustmaster Cougar Throttle

Pilot seat

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...