yue3004 Posted July 6, 2016 Posted July 6, 2016 In the case “Alphajet” of avionics.lua local pitch = get_param_handle("D_PITCH") function update() pitch:set(sensor_data.getStickRollPosition()) end end In the case “Alphajet” of indication_page.lua local PitchScaleParam = CreateElement "ceTexPoly" --this could be the text area on HUD PitchScaleParam.name = create_guid_string() -- this must be external function call. PitchScaleParam.vertices = {{-grid_radius, grid_radius}, { grid_radius, grid_radius}, { grid_radius,-grid_radius}, {-grid_radius,-grid_radius}} PitchScaleParam.indices = {0,1,2,2,3,0} PitchScaleParam.tex_coords = {{0,0},{1,0},{1,1},{0,1}} PitchScaleParam.material = PitchScale PitchScaleParam.element_params = {"D_PITCH"} -- Global Variable to test PitchScaleParam.controllers = {{"move_up_down_using_parameter",0,0}} PitchScaleParam.collimated = true PitchScaleParam.parent_element = grid_origin.name AddElement(PitchScaleParam) hud pitch did not move up and down。help me,thank guys。
gyrovague Posted August 4, 2016 Posted August 4, 2016 Does your avionics.lua have a make_default_activity call in it? Otherwise your update function won't be called I think, e.g. local update_time_step = 0.05 --20 times per second make_default_activity(update_time_step) Also, I think the 3rd param of that controllers entry should be non-zero, e.g. PitchScaleParam.controllers = {{"move_up_down_using_parameter",0,0.5}} I think that controls the scale between the param value and how much it moves, can also be negative. Hope this helps. ____________ Heatblur Simulations [sIGPIC][/sIGPIC]
Recommended Posts