Beispiel #1
0
 public SvgImage(string name, SvgData svgData)
     : base(name,
            Vector2.Zero,
            new Rectf(Vector2.Zero, new Sizef(svgData.getWidth(), svgData.getHeight())),
            AutoScaledMode.Disabled,
            new Sizef(640f, 480f))
 {
     d_svgData = svgData;
     d_useGeometryAntialiasing = true;
 }
        /*!
         * \brief
         * Creates an instance of SVGData class registered using the name \a name.
         *
         * \param name
         * String object describing the name that the newly created instance will
         * be created with.  This name must be unique within the system.
         *
         * \param filename
         * String object that specifies the path and filename of the image file to
         * use when creating the texture.
         *
         * \param resourceGroup
         * String object that specifies the resource group identifier to be passed
         * to the resource provider when loading the texture file \a filename.
         *
         * \exception UnknownObjectException
         * thrown if no Image subclass has been registered using identifier \a type.
         *
         * \exception AlreadyExistsException
         * thrown if an Image instance named \a name already exists.
         */

        public SvgData Create(string name, string filename, string resourceGroup)
        {
            if (_svgDataMap.ContainsKey(name))
            {
                throw new AlreadyExistsException("An SVGData object named " + name + " already exists.");
            }

            var svg_data = new SvgData(name, filename, resourceGroup);

            _svgDataMap[name] = svg_data;

            LogSvgDataCreation(svg_data);

            return(svg_data);
        }
        /*!
         * \brief
         * Destroys the SVGData object.
         *
         * \param svgData
         * The object to destroy
         */

        public void Destroy(SvgData svgData)
        {
            Destroy(svgData.getName());
        }
 /// <summary>
 /// Logs the creation of the SVGData object.
 /// </summary>
 /// <param name="svgData">
 /// The SVGData object that was created.
 /// </param>
 private void LogSvgDataCreation(SvgData svgData)
 {
     System.GetSingleton().Logger
     .LogEvent("[SVGDataManager] Created SVGData object: '" + svgData.getName() + "' " +
               "(" + svgData.GetHashCode().ToString("X8") + ")");
 }
Beispiel #5
0
 /// <summary>
 /// Sets the SVGData object of this SVGImage.
 /// </summary>
 /// <param name="svgData">
 /// The pointer to the SVGData object to be used by this SVGImage. Can be 0.
 /// </param>
 public void SetSvgData(SvgData svgData)
 {
     d_svgData = svgData;
 }