Hi,
Pushing forward at a good pace...
Got a problem now that we can't seem to fix:
How can we access an AppGameKit Sprite from "main.agc" in "screens.agc" ?
Hope someone can help us now, dev is halted until this issue is fixed...
Full project source code below:
// "main.agc"...
remstart
-----------------------------------------------------------------------------------
JeZxLee's
_ _ ____ _ _ _ _ _ _ _____ _ _ ___ _ ___ _TM
( | ) _ \(_)_ _____| | / \ _ __| |_(_)___| |_ |___ / / / |/ _ (_)/ ( | )
V V| |_) | \ \/ / _ \ | / _ \ | '__| __| / __| __| |_ \ | | | | | |/ / V V
| __/| |> < __/ | / ___ \| | | |_| \__ \ |_ ___) | | | | |_| / /_
|_| |_/_/\_\___|_| /_/ \_\_| \__|_|___/\__| |____/ |_|_|\___/_/(_)
Google Android SmartPhones/Tablets & HTML5 Desktop/Notebook Internet Browsers
(C)opyright 2017, By Team "www.16BitSoft.com"
-----------------------------------------------------------------------------------
remend
#include "screens.agc"
#include "visuals.agc"
SetErrorMode(2)
global ScreenWidth = 360
global ScreenHeight = 640
global CurrentMinTextIndex = 1
#constant FadingIdle -1
#constant FadingFromBlack 0
#constant FadingToBlack 1
global ScreenFadeStatus = FadingFromBlack
global ScreenFadeTransparency = 255
LoadImage ( 1, "\media\images\FadingBlack-BG.png" )
FadingBlackBG = CreateSprite ( 1 )
SetSpriteDepth ( FadingBlackBG, 0 )
global ScreenToDisplay = 0
global NextScreenToDisplay = 1
SetWindowTitle( "Pixel Artist 3 110%[TM]" )
SetWindowSize( ScreenWidth, ScreenHeight, 0 )
SetWindowAllowResize( 1 )
SetScreenResolution( ScreenWidth, ScreenHeight )
SetVirtualResolution( ScreenWidth, ScreenHeight )
SetOrientationAllowed( 1, 0, 0, 0 )
SetSyncRate( 30, 0 )
SetScissor( 0,0,0,0 )
UseNewDefaultFonts( 1 )
LoadFont( 999, "\media\fonts\Akashi.ttf" )
LoadImage ( 3, "\media\images\Title-BG.png" )
TitleBG = CreateSprite ( 3 )
LoadImage ( 4, "\media\images\PA3-Logo.png" )
PA3Logo = CreateSprite ( 4 )
SetSpriteOffset( PA3Logo, (GetSpriteWidth(PA3Logo)/2) , (GetSpriteHeight(PA3Logo)/2) )
SetSpritePositionByOffset( PA3Logo, ScreenWidth/2, 49 )
CreateAndInitializeOutlinedText(CurrentMinTextIndex, "©2017 By Team ''www.16BitSoft.com''", 999, 19, 255, 255, 255, 255, 0, 0, 0, 1, ScreenWidth/2, ScreenHeight-32, 1)
CreateAndInitializeOutlinedText(CurrentMinTextIndex, "''JeZxLee''", 999, 19, 255, 255, 255, 255, 0, 0, 0, 1, ScreenWidth/2, 95, 1)
CreateAndInitializeOutlinedText(CurrentMinTextIndex, "10000", 999, 19, 255, 255, 255, 255, 0, 0, 0, 1, ScreenWidth/2, 95+21, 1)
CreateAndInitializeOutlinedText(CurrentMinTextIndex, " ", 999, 10, 0, 255, 0, 255, 0, 128, 0, 0, 6, ScreenHeight-12, 1)
CreateAndInitializeOutlinedText(CurrentMinTextIndex, "Pre-Alpha", 999, 10, 0, 255, 0, 255, 0, 128, 0, 2, ScreenWidth-6, ScreenHeight-12, 1)
LoadMusicOGG( 1, "\media\music\Title-01.ogg" )
PlayMusicOGG( 1, 1 )
do
SetTextStringOutlined ( CurrentMinTextIndex-(27*2), str( Round( ScreenFPS() ) ) )
ApplyScreenFadeTransition()
SetSpriteColorAlpha( FadingBlackBG, ScreenFadeTransparency ) //Want this call in "screens.agc"
Render2DFront()
Sync()
loop
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// "screens.agc"...
function ApplyScreenFadeTransition ( )
if ScreenFadeStatus = FadingFromBlack
if ScreenFadeTransparency > 4
dec ScreenFadeTransparency, 5
else
ScreenFadeTransparency = 0
ScreenFadeStatus = FadingIdle
endif
elseif ScreenFadeStatus = FadingToBlack
if ScreenFadeTransparency < 251
inc ScreenFadeTransparency, 5
else
ScreenFadeTransparency = 255
ScreenFadeStatus = FadingFromBlack
//DestroyAllGUI()
ScreenToDisplay = NextScreenToDisplay
endif
endif
//SetSpriteColorAlpha( FadingBlackBG, ScreenFadeTransparency ) <---ERROR?
endfunction
//------------------------------------------------------------------------------------------------------------
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// "visuals.agc"...
function ClearScreenWithColor ( red as integer, green as integer, blue as integer )
SetClearColor( red, green, blue )
ClearScreen()
endfunction
//------------------------------------------------------------------------------------------------------------
function CreateAndInitializeOutlinedText (index as integer, text as string, font as integer, size as integer, red as integer, green as integer, blue as integer, alpha as integer, outRed as integer, outGreen as integer, outBlue as integer, horizontalJustification as integer, screenX as integer, screenY as integer, depth as integer )
outlineIndex = 1
for posX = -2 to 2 step 1
for posY = -2 to 2 step 1
CreateText( index+outlineIndex, text )
SetTextFont( index+outlineIndex, font )
SetTextSize(index+outlineIndex, size)
SetTextColor(index+outlineIndex, outRed, outGreen, outBlue, alpha)
SetTextAlignment(index+outlineIndex, horizontalJustification)
SetTextPosition(index+outlineIndex, screenX+posX, screenY+posY)
SetTextDepth(index+outlineIndex, depth)
inc outlineIndex, 1
next posY
next posX
CreateText( index, text )
SetTextFont( index, font )
SetTextSize(index, size)
SetTextColor(index, red, green, blue, alpha)
SetTextAlignment(index, horizontalJustification)
SetTextPosition(index, screenX, screenY)
SetTextDepth(index, depth)
inc CurrentMinTextIndex, outlineIndex
endfunction //index
//------------------------------------------------------------------------------------------------------------
function SetTextStringOutlined (index as integer, textString as string)
for textIndex = index to (index+26)
SetTextString ( textIndex, textString )
next textIndex
endfunction