Big3DViewDialog

From Vendetta Lua
Revision as of 22:20, 25 November 2008 by Chefkoch (Talk | contribs) (New page: A fullscreen dialog with a modelview, containing a rotating ship, and a close button. It is created with CreateBig3DViewMenu. == Functions == === ...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A fullscreen dialog with a modelview, containing a rotating ship, and a close button. It is created with CreateBig3DViewMenu.


Functions

SetShip

Definition:
SetShip(userdata dialog, string meshname, string meshfile, int color) -> nil

Description:
Set ship to display. The arguments are provided by GetShipMeshInfo, GetStationMerchInfo or GetStationMerchInfoByID

Arguments:
dialog this dialog
meshname id of ship to display
meshfile file name of ship mesh
color colorid

SetOwner

Definition:
SetOwner(userdata dialog, userdata owner) -> nil

Description:
Dialog to show after clicking on the "close" button. Usually the one that opened it.

Arguments:
dialog this dialog
owner owning dialog

Example

-- creates a dialog with a button that pops up a Big3DViewDialog with the current ship when clicked and returns to it when closed
 
-- create a new Big3DViewDialog
local b3d = CreateBig3DViewMenu()
-- create dialog with button
local b = iup.button{title="Click Me"}
local d = iup.dialog{b, topmost="yes"}
 
-- action that sets the ship, closes the dialog and opens the 3d view on click
function b:action()
	local id, file, color = GetShipMeshInfo()
	b3d:SetShip(id, file, color)
	HideDialog(d)
	ShowDialog(b3d)
end
 
-- pop up initial dialog on close
b3d:SetOwner(d)
 
-- show the thing
ShowDialog(d)