Build dynamic animated graphics using vector drawing and animation capabilities. Create moving equipment, flowing pipes, and interactive process animations.
What You'll Learn
- Draw vector graphics
- Create path animations
- Animate properties
- Build interactive animations
Prerequisites
- Display editor basics
- Understanding of process graphics
Step 1: Vector Drawing Basics
- Open Displays → Draw
- Use drawing tools:
Basic Shapes:
- Rectangle: Tank outline
- Ellipse: Pump body
- Line: Piping
- Polygon: Custom shapes
- Path: Complex curves
Combine Shapes:
- Select multiple
- Right-click → Combine
- Union, Subtract, Intersect
Step 2: Create Animated Fill
Build tank with level animation:
- Draw rectangle (tank)
- Add inner rectangle (liquid)
- Liquid properties:
- Fill: Blue gradient
- Height: Bind to expression
csharp
@Tag.Tank_Level * TankHeight / 100
- Clip to tank bounds
Step 3: Rotation Animation
Create rotating equipment:
Pump Impeller:
- Draw impeller shape
- Add rotation dynamic:
- Center: Object center
- Angle expression:
csharp
@Tag.Pump_Running ? @Tag.AnimationAngle : 0
- In Scripts, increment angle:
csharp
@Tag.AnimationAngle = (@Tag.AnimationAngle + 5) % 360;
Step 4: Path Animation
Animate object along path:
- Draw path (invisible line)
- Place object (e.g., product icon)
- Add path animation:
- Path: Select drawn path
- Duration: 5 seconds
- Trigger:
@Tag.Conveyor_Running
- Repeat: Continuous
Step 5: Flow Animation
Create pipe flow effect:
- Draw pipe outline
- Add dashed line inside
- Animate dash offset:
csharp
@Tag.Flow_Active ? @Tag.DashOffset : 0
- Increment offset in script:
csharp
@Tag.DashOffset = (@Tag.DashOffset + 2) % 20;
Step 6: Color Animations
Dynamic color changes:
State-based Color:
csharp
// Pipe color by material
Fill = @Tag.Material == "Water" ? "Blue" :
@Tag.Material == "Oil" ? "Brown" :
@Tag.Material == "Gas" ? "LightGray" : "White"
Gradient Animation:
- Create gradient fill
- Animate gradient stops
- Bind to temperature/pressure
Step 7: Visibility Animations
Show/hide elements:
Blinking Alarm:
csharp
Visibility = @Tag.Alarm && @Tag.BlinkState ?
Visibility.Visible : Visibility.Hidden
Toggle blink state every 500ms
Progressive Disclosure:
- Show details on hover
- Hide when normal
- Smooth fade transition
Step 8: Transform Animations
Scale Animation:
csharp
// Pulse effect for alarms
ScaleX = @Tag.Alarm ? 1.0 + (Math.Sin(@Tag.PulseAngle) * 0.1) : 1.0
ScaleY = ScaleX
Translation:
- Move objects based on position
- Slider controls
- Drag and drop
Step 9: Complex Equipment
Build multi-part animation:
Conveyor Belt:
- Belt graphic with pattern
- Product objects
- Animations:
- Belt pattern scrolling
- Products moving
- Speed variable
- Start/stop control
Centrifuge:
- Outer casing (static)
- Inner drum (rotating)
- Material flow (path animation)
- Speed indicator
Step 10: Interactive Animations
Add user interaction:
Click Actions:
csharp
void OnValveClick()
{
if (@Tag.Mode == "Manual")
{
@Tag.Valve_Position = @Tag.Valve_Position > 50 ? 0 : 100;
}
}
Drag to Adjust:
- Implement slider behavior
- Update tag while dragging
- Show value tooltip
Performance Tips
Optimize Animations:
- Limit simultaneous animations
- Use appropriate frame rates
- Disable when not visible
- Simplify complex paths
- Cache static elements
Best Practices:
- Smooth transitions (ease-in/out)
- Consistent animation speeds
- Meaningful animations only
- Test on target hardware
- Provide animation on/off option
Advanced Techniques
Particle Effects:
csharp
// Bubbles in tank
for(int i = 0; i < 10; i++)
{
CreateBubble(
RandomX(),
TankBottom,
RandomSize(),
RandomSpeed()
);
}
3D-like Effects:
- Perspective transforms
- Shadows and lighting
- Depth ordering
Next Steps
- [Working with Symbols] - Reusable animations
- [Create Dashboards] - Animated KPIs
- [Vector Graphics Drawing] - Advanced drawing