Expandable Menu System

Here is the menuGraphics egg to go along with that example, and the images it uses.
EDIT: I removed Menu1 and Menu4 images because they stretched the forum window too much. I also changed the egg so it wouldn’t try to load them. They aren’t actually used in the example, so it’s no big deal.

<Comment> {
  "egg-texture-cards -wm clamp -g -.125,.125,-.025,.025 -p 250,50 -o MenuGraphics.egg BttnNormal.png BttnPushed.png Menu0.png Menu1.png Menu2.png Menu3.png Menu4.png"
}
<Texture> Menu4 {
  ../Images/Menu0.png
  <Scalar> wrap { clamp }
}
<Texture> Menu3 {
  ../Images/Menu3.png
  <Scalar> wrap { clamp }
}
<Texture> Menu2 {
  ../Images/Menu2.png
  <Scalar> wrap { clamp }
}
<Texture> Menu1 {
  ../Images/Menu0.png
  <Scalar> wrap { clamp }
}
<Texture> Menu0 {
  ../Images/Menu0.png
  <Scalar> wrap { clamp }
}
<Texture> BttnPushed {
  ../Images/BttnPushed.png
  <Scalar> wrap { clamp }
}
<Texture> BttnNormal {
  ../Images/BttnNormal.png
  <Scalar> wrap { clamp }
}
<Group> {
  <Switch> { 1 }
  <Scalar> fps { 2 }
  <VertexPool> vpool {
    <Vertex> 0 {
      -0.125 0.025 0
      <UV> { 0 1 }
    }
    <Vertex> 1 {
      -0.125 -0.025 0
      <UV> { 0 0 }
    }
    <Vertex> 2 {
      0.125 -0.025 0
      <UV> { 1 0 }
    }
    <Vertex> 3 {
      0.125 0.025 0
      <UV> { 1 1 }
    }
    <Vertex> 4 {
      -0.125 0.025 0
      <UV> { 0 1 }
    }
    <Vertex> 5 {
      -0.125 -0.025 0
      <UV> { 0 0 }
    }
    <Vertex> 6 {
      0.125 -0.025 0
      <UV> { 1 0 }
    }
    <Vertex> 7 {
      0.125 0.025 0
      <UV> { 1 1 }
    }
    <Vertex> 8 {
      -0.175 0.2875 0
      <UV> { 0 1 }
    }
    <Vertex> 9 {
      -0.175 -0.2875 0
      <UV> { 0 0 }
    }
    <Vertex> 10 {
      0.175 -0.2875 0
      <UV> { 1 0 }
    }
    <Vertex> 11 {
      0.175 0.2875 0
      <UV> { 1 1 }
    }
    <Vertex> 12 {
      -0.7625 0.3875 0
      <UV> { 0 1 }
    }
    <Vertex> 13 {
      -0.7625 -0.3875 0
      <UV> { 0 0 }
    }
    <Vertex> 14 {
      0.7625 -0.3875 0
      <UV> { 1 0 }
    }
    <Vertex> 15 {
      0.7625 0.3875 0
      <UV> { 1 1 }
    }
    <Vertex> 16 {
      -0.2875 0.2125 0
      <UV> { 0 1 }
    }
    <Vertex> 17 {
      -0.2875 -0.2125 0
      <UV> { 0 0 }
    }
    <Vertex> 18 {
      0.2875 -0.2125 0
      <UV> { 1 0 }
    }
    <Vertex> 19 {
      0.2875 0.2125 0
      <UV> { 1 1 }
    }
    <Vertex> 20 {
      -0.475 0.2125 0
      <UV> { 0 1 }
    }
    <Vertex> 21 {
      -0.475 -0.2125 0
      <UV> { 0 0 }
    }
    <Vertex> 22 {
      0.475 -0.2125 0
      <UV> { 1 0 }
    }
    <Vertex> 23 {
      0.475 0.2125 0
      <UV> { 1 1 }
    }
    <Vertex> 24 {
      -0.8 0.15 0
      <UV> { 0 1 }
    }
    <Vertex> 25 {
      -0.8 -0.15 0
      <UV> { 0 0 }
    }
    <Vertex> 26 {
      0.8 -0.15 0
      <UV> { 1 0 }
    }
    <Vertex> 27 {
      0.8 0.15 0
      <UV> { 1 1 }
    }
  }
  <Group> BttnNormal {
    <Polygon> {
      <RGBA> { 1 1 1 1 }
      <TRef> { BttnNormal }
      <VertexRef> { 0 1 2 3 <Ref> { vpool } }
    }
  }
  <Group> BttnPushed {
    <Polygon> {
      <RGBA> { 1 1 1 1 }
      <TRef> { BttnPushed }
      <VertexRef> { 4 5 6 7 <Ref> { vpool } }
    }
  }
  <Group> Menu0 {
    <Polygon> {
      <RGBA> { 1 1 1 1 }
      <TRef> { Menu0 }
      <VertexRef> { 8 9 10 11 <Ref> { vpool } }
    }
  }
  <Group> Menu1 {
    <Polygon> {
      <RGBA> { 1 1 1 1 }
      <TRef> { Menu1 }
      <VertexRef> { 12 13 14 15 <Ref> { vpool } }
    }
  }
  <Group> Menu2 {
    <Polygon> {
      <RGBA> { 1 1 1 1 }
      <TRef> { Menu2 }
      <VertexRef> { 16 17 18 19 <Ref> { vpool } }
    }
  }
  <Group> Menu3 {
    <Polygon> {
      <RGBA> { 1 1 1 1 }
      <TRef> { Menu3 }
      <VertexRef> { 20 21 22 23 <Ref> { vpool } }
    }
  }
  <Group> Menu4 {
    <Polygon> {
      <RGBA> { 1 1 1 1 }
      <TRef> { Menu4 }
      <VertexRef> { 24 25 26 27 <Ref> { vpool } }
    }
  }
}

Menu0

Menu2

Menu3

BttnNormal

BttnPushed