<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Scaleform Progress Bar in Stingray Forum (Read Only)</title>
    <link>https://forums.autodesk.com/t5/stingray-forum-read-only/scaleform-progress-bar/m-p/6304550#M4623</link>
    <description>&lt;P&gt;Paul,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Oh interesting. The progress bar widget defers to the animation timeline as a form of measurement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 02 May 2016 20:43:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-05-02T20:43:12Z</dc:date>
    <item>
      <title>Scaleform Progress Bar</title>
      <link>https://forums.autodesk.com/t5/stingray-forum-read-only/scaleform-progress-bar/m-p/6299584#M4562</link>
      <description>&lt;P&gt;Howdy All,&lt;/P&gt;&lt;P&gt;I can't seem to find a way to update Scaleform Progress Bar through Flow or Lua. If there are additional documentation on how to set this up that would be Awesome!&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2016 02:56:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/stingray-forum-read-only/scaleform-progress-bar/m-p/6299584#M4562</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-29T02:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: Scaleform Progress Bar</title>
      <link>https://forums.autodesk.com/t5/stingray-forum-read-only/scaleform-progress-bar/m-p/6301294#M4572</link>
      <description>&lt;P&gt;I found a Progress Bar example along with some other widget examples, in&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C:\Program Files\Autodesk\Stingray\1.2.564.5\editor\ScaleformStudio\content\projects\WidgetCollection\&lt;SPAN&gt;WidgetCollection.s2dproj&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My exercise is to turn a Progress Bar into a Health Bar. I hope to come up with something. If anyone has a solution&amp;nbsp;to this exercise feel free to post. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2016 22:08:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/stingray-forum-read-only/scaleform-progress-bar/m-p/6301294#M4572</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-29T22:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Scaleform Progress Bar</title>
      <link>https://forums.autodesk.com/t5/stingray-forum-read-only/scaleform-progress-bar/m-p/6301442#M4573</link>
      <description>&lt;P&gt;Yup... great scaleform widget examples in&amp;nbsp;&lt;SPAN&gt;WidgetCollection.s2dproj file.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Apr 2016 01:02:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/stingray-forum-read-only/scaleform-progress-bar/m-p/6301442#M4573</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-30T01:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Scaleform Progress Bar</title>
      <link>https://forums.autodesk.com/t5/stingray-forum-read-only/scaleform-progress-bar/m-p/6301505#M4574</link>
      <description>&lt;P&gt;I confess I am so new to game programming... can someone explain the intent for these lines of code from Progress Bar Widget.lua&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;scaleform.AnimationComponent.goto_label(mainContainer, "started");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;scaleform.AnimationComponent.goto_label(mainContainer, "normal");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is a lua code to make a Progress Bar into a Health Bar using the ProgressBarWidget. If it does not work, drop me a line.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;--
-- IMPORTANT: This script resource may be attached to all progress bar widgets created by the Widget Creator panel.
--            If modifications are required, then first copy this file to a unique path and fix all necessary
--            script components' resource paths.
--

--[[ Create this Function in any *.lua file but make sure there is a 'require' associated with it, &lt;BR /&gt;in my case its in Project.lua so no 'require' needed. Then you can call it in Flow.

function Project.updateShipHealth(myVar)
    local actorProgressBar = scaleform.Stage.actor_by_name_path("Scene0.Ship_Health_PB");
	local widget = scaleform.Actor.component_by_name(actorProgressBar, "WidgetBase");
	local widgetApi = scaleform.ScriptComponent.script_results(widget);
	
	widgetApi.setProgress(myVar);
end

]]--

-- Modified ProgressBarWidget.lua&lt;BR /&gt;
local thisActor = ...;
local currentProgressBarPercentage = 101;
scaleform.Actor.set_mouse_enabled_for_children(thisActor, false);

local emitEvent = function(func, param)
    local comp = scaleform.Actor.component_by_name(thisActor, "WidgetHandler");
    if comp ~= nil then
        local handlerObject = scaleform.ScriptComponent.script_results(comp);
        if handlerObject ~= nil then
            if handlerObject[func] ~= nil then
                if (param) then
                    handlerObject[func](param);
                else
                    handlerObject[func]();
                end
            end
        end
    end
end

-- Helper function to set the current progress of the widget (0 to 100)
local setProgress = function(progressPercentage)

    if (progressPercentage &amp;lt; 0) then progressPercentage = 0; end
    if (progressPercentage &amp;gt; 100) then progressPercentage = 100; end

    local mainContainer = scaleform.Actor.container(thisActor);
    
    -- Process only if progression has changed.
    if (currentProgressBarPercentage ~= progressPercentage) then

        currentProgressBarPercentage = progressPercentage;
        
        if (currentProgressBarPercentage &amp;gt; 0) then
            if (currentProgressBarPercentage == 100) then
                emitEvent("started");
            end
            --scaleform.AnimationComponent.goto_label(mainContainer, "started");
        else
           --scaleform.AnimationComponent.goto_label(mainContainer, "normal");
        end

        if (currentProgressBarPercentage &amp;gt; 0) then
            local bitmap = scaleform.ContainerComponent.actor_by_name(mainContainer, "bitmap");
            
            if (bitmap) then
                scaleform.Actor.set_local_scale( bitmap, {x=currentProgressBarPercentage/100.0, y=1.0} ) ;
                emitEvent("onProgress", currentProgressBarPercentage);
            end
        end

        if (currentProgressBarPercentage &amp;lt;= 0) then
            --Old version if (currentProgressBarPercentage == 100) then
            emitEvent("complete");
        end
    end
end

-- Helper function to increment the current progress of the widget (0 to 100)
local incrementProgress = function()
    if (currentProgressBarPercentage &amp;lt; 100) then
        setProgress(currentProgressBarPercentage+1);
    end
end

-- Helper function to reset the current progress of the widget.
local resetProgress = function()
    --setProgress(0);
    setProgress(100);
end

-- Helper function to get  the current progress of the widget.
local getProgress = function()
    return currentProgressBarPercentage;
end

-- Save the methods below in this script component to use them from elsewhere
local exports = {
    incrementProgress = incrementProgress;
    setProgress = setProgress;
    resetProgress = resetProgress;
    getProgress = getProgress;
}
return exports;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Apr 2016 04:31:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/stingray-forum-read-only/scaleform-progress-bar/m-p/6301505#M4574</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-30T04:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Scaleform Progress Bar</title>
      <link>https://forums.autodesk.com/t5/stingray-forum-read-only/scaleform-progress-bar/m-p/6303588#M4598</link>
      <description>&lt;P&gt;Hi Joseph&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you double click within the widget you will notice there is an animation timeline in there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;scaleform.AnimationComponent.goto_label(mainContai&lt;WBR /&gt;ner, "started");&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;scaleform.AnimationComponent.goto_label(mainContai&lt;WBR /&gt;ner, "normal");&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Both of these lines are telling to the animation component to set the playhead (goto_label) within the timeline of the animation component to jump to "started" and "normal" respectively. &amp;nbsp;Markers are on the timeline in this case within "AnimationComponent" and are used to designate a specific frame within an animation.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Paul&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2016 12:59:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/stingray-forum-read-only/scaleform-progress-bar/m-p/6303588#M4598</guid>
      <dc:creator>paulkind</dc:creator>
      <dc:date>2016-05-02T12:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: Scaleform Progress Bar</title>
      <link>https://forums.autodesk.com/t5/stingray-forum-read-only/scaleform-progress-bar/m-p/6304550#M4623</link>
      <description>&lt;P&gt;Paul,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Oh interesting. The progress bar widget defers to the animation timeline as a form of measurement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2016 20:43:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/stingray-forum-read-only/scaleform-progress-bar/m-p/6304550#M4623</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-02T20:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Scaleform Progress Bar</title>
      <link>https://forums.autodesk.com/t5/stingray-forum-read-only/scaleform-progress-bar/m-p/6499293#M5662</link>
      <description>&lt;P&gt;I think i found away to create a custom progress bar of any shape or sizes instead of straight bar. and without use of code &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; ..&amp;nbsp; for this&lt;/P&gt;&lt;P&gt;&amp;nbsp;Create a background actor with total dimension of the actual length of progress bar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Make it animation component container to contain more actors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Now add a bitmap image &amp;nbsp;fill color to&amp;nbsp;fill the background of same size in width and height.. &amp;nbsp;&lt;/P&gt;&lt;P&gt;You can further use animated type as well. in form of fill&lt;/P&gt;&lt;P&gt;Now dublicate&amp;nbsp;the background layer and it as a masking layer to mask the fill layer..&lt;/P&gt;&lt;P&gt;Keep the mask over to the side so that its no longer covering the fill. make sure the masking layer is of same size as that of background.&lt;/P&gt;&lt;P&gt;Go to the timeline of masking layer and mark keyframes from 1 to 100 frames. &amp;nbsp;&lt;/P&gt;&lt;P&gt;Now animate the mask layer at 1 frame to just a bit over the fill to reveal small amount i.e (1%).. &amp;nbsp;and at 100. &amp;nbsp;move it along all the way over the fill i.e 100%&lt;/P&gt;&lt;P&gt;Now mark each step on timeline &amp;nbsp;so that at every frame you get increamental&amp;nbsp;orders of percentage over timeline And Wollahh!!.. &amp;nbsp;you have custom progress bar. Now you just have to send command to go to such and such frame on timeline and you'll get the progress of it because you have divided your timeline of 100 frames as a form of measurement and you can directly plug the number of frame to play based of any increamental stages you want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;For Continues progress bar instead of marking each frame ad linear tween between 1 to 100 frames &amp;nbsp;and at stop action at frame 1 and whenever you want to start just set it to go to frame 2 to play as continues progress bar..&lt;/P&gt;&lt;P&gt;with this structure you can have any style of progress bar as either rectangular, circular, spherical, fills etc its only a matter of how you animate the mask layer. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Aug 2016 18:04:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/stingray-forum-read-only/scaleform-progress-bar/m-p/6499293#M5662</guid>
      <dc:creator>Shanii2</dc:creator>
      <dc:date>2016-08-14T18:04:09Z</dc:date>
    </item>
  </channel>
</rss>

