Post #1 · Publicado en 2019-07-21 07:08:29am Hace 5.1 años
Engine_Machiner | |
---|---|
Member | |
222 Mensajes | |
Reg. 2014-01-16 | |
"~The message~" |
I'm trying to create a mirrored texture with an ActorFrameTexture (1 texture mirrored by each side). It's for the Kaleidoscope effect of the BGA project, I don't know much about the AFT (or even if this is the way AFT is supposed to work), but I would like to know if it is possible to create the texture and make a Sprite load the texture to scroll it.
I've tried using GetTexture() and SetTexture() but it gives me a white texture.
Here's the code:
https://pastebin.com/RMitWJZ7
Here's what happens when I try calling the string of the Texture in the last Def.Sprite:
https://imgur.com/QP2AzGb
The texture does loads in the AFT but after that I don't know why it isn't loading in the Sprite.
The code was based in the examples of the Docs.
I've tried using GetTexture() and SetTexture() but it gives me a white texture.
Here's the code:
https://pastebin.com/RMitWJZ7
Here's what happens when I try calling the string of the Texture in the last Def.Sprite:
https://imgur.com/QP2AzGb
The texture does loads in the AFT but after that I don't know why it isn't loading in the Sprite.
The code was based in the examples of the Docs.
Post #2 · Publicado en 2019-07-21 01:27:13pm Hace 5.1 años
leadbman | |
---|---|
Member | |
263 Mensajes | |
Reg. 2016-02-01 | |
"Working On: 5thMix BGA bgchanges" |
Have you tried putting the for loop after the def.sprite for Example 1? Maybe it needs to load the sprite first before the loop, otherwise, there's nothing for it to call for the first loop. Not sure if that's the answer though - it's possibly not but it may be worth a try. I'd have to check it out.
t[#t+1] = Def.Sprite{
Texture="Example 1",
OnCommand=function(self)
self:Center()
end
}
for i = 1,4 do
t_tex[#t_tex+1] = Def.Sprite{
etc, etc.
Texture="Example 1",
OnCommand=function(self)
self:Center()
end
}
for i = 1,4 do
t_tex[#t_tex+1] = Def.Sprite{
etc, etc.
Post #3 · Publicado en 2019-07-21 05:35:03pm Hace 5.1 años
Engine_Machiner | |
---|---|
Member | |
222 Mensajes | |
Reg. 2014-01-16 | |
"~The message~" |
Last updated: 2019-07-21 09:54pm
Quote
Have you tried putting the for loop after the def.sprite for Example 1? Maybe it needs to load the sprite first before the loop, otherwise, there's nothing for it to call for the first loop. Not sure if that's the answer though - it's possibly not but it may be worth a try. I'd have to check it out.
https://imgur.com/2PSCngn
Ok, I have doubts about using InitCommand or OnCommand in the AFT, also I tried what you said and it gave me a white texture.
Maybe it is the same as the GetTexture() and SetTexture() thing I did getting the same white texture.
For reference, I'm trying to get the second example and scroll it
Post #4 · Publicado en 2019-07-21 11:13:22pm Hace 5.1 años
ActorFrameTextures are not supported when SM5 is using d3d as the video renderer. The issue (the code was never written) manifests as a white texture. There was a GitHub issue that discussed this a while back, but the issue is unlikely to ever be fixed with the current engine.
If you want to use ActorFrameTextures, you (and your users) must be using opengl as the VideoRenderer. It seems unreasonable to expect all users of your work to be using opengl since d3d is the default renderer for Windows OS.
You could include some conditional checks in your BGA code like
but then you'd have to write twice as much code. My general approach in theming is to not rely on AFTs because they will fail by default for most users, most users don't know where their Preferences.ini file is, and they really should not have to change it in the first place.
Perhaps if you explain what you are trying to accomplish, someone here can help you find a way to achieve that without using AFTs.
If you want to use ActorFrameTextures, you (and your users) must be using opengl as the VideoRenderer. It seems unreasonable to expect all users of your work to be using opengl since d3d is the default renderer for Windows OS.
You could include some conditional checks in your BGA code like
Quote: "code"
if DISPLAY:SupportsRenderToTexture() then
-- use ActorFrameTexture
else
-- do something else
end
-- use ActorFrameTexture
else
-- do something else
end
but then you'd have to write twice as much code. My general approach in theming is to not rely on AFTs because they will fail by default for most users, most users don't know where their Preferences.ini file is, and they really should not have to change it in the first place.
Perhaps if you explain what you are trying to accomplish, someone here can help you find a way to achieve that without using AFTs.
Post #5 · Publicado en 2019-07-22 04:17:30am Hace 5.1 años
Engine_Machiner | |
---|---|
Member | |
222 Mensajes | |
Reg. 2014-01-16 | |
"~The message~" |
Last updated: 2019-07-22 04:17am
Oh no, welp, guess AFTs are not an option then...
I want to use texcoordvelocity() and customtexturerect() with the song's BG, but I want the texture of the BG to be mirrored like you see here: (The second picture GL_MIRRORED_REPEAT)
It's for the kaleidoscope effect I was working with, because if the song's BG isn't mirrored when scrolling it looks just like a bad cropped thing. (Like what you see in the first picture of above GL_REPEAT)
I want to use texcoordvelocity() and customtexturerect() with the song's BG, but I want the texture of the BG to be mirrored like you see here: (The second picture GL_MIRRORED_REPEAT)
Quote
It's for the kaleidoscope effect I was working with, because if the song's BG isn't mirrored when scrolling it looks just like a bad cropped thing. (Like what you see in the first picture of above GL_REPEAT)