Obj with no wall insertion

From Vectorlab
Jump to: navigation, search


Object that won't go into a wall:

by  Charles Chandler, Januar 2007

PROCEDURE Example2;
CONST
	kObjOnInitXProperties = 5;
	kResetEventID = 3;
	kObjXPropPreventWallInsertion = 7;
VAR
	theEvent, theButton :LONGINT;
	result :BOOLEAN;
BEGIN
	vsoGetEventInfo(theEvent, theButton);
	CASE theEvent OF

		{User has single-clicked the object's icon.}
		kObjOnInitXProperties: 
			BEGIN
				{This tells VW to abort the creation of a new instance
				of the object if the user has clicked on top of a wall.}
				result := SetObjPropVS(kObjXPropPreventWallInsertion, TRUE);
			END;

		{Object reset has been called.}
		kResetEventID: 
			BEGIN
				Rect(0, 0, 1, 1);
			END;

	END;
END;
RUN(Example2);

See also

Events