
squirreltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2015
04:20 PM
creepycrawler?
Wow i thinks i found an actual bug...errr Feature! yea thats it.
OK.
screen.Drawscaledobject( 620, 230, 2, 2, varr.but_off ) 'good
So the scale params are supposed to be floats, natch but the above works.
Until you add the ( i swear i saw it somewhere - recently documented alpha parameter) then it errors with type mismatch
screen.Drawscaledobject( 620, 230, 2, 2, varr.but_off, &hFFFFFF99 ) 'no good
but when you do it correctly:
screen.Drawscaledobject( 620, 230, 2.0,2.0, varr.but_off, &hFFFFFF99) 'good
Now it flys!
OK.
screen.Drawscaledobject( 620, 230, 2, 2, varr.but_off ) 'good
So the scale params are supposed to be floats, natch but the above works.
Until you add the ( i swear i saw it somewhere - recently documented alpha parameter) then it errors with type mismatch
screen.Drawscaledobject( 620, 230, 2, 2, varr.but_off, &hFFFFFF99 ) 'no good
but when you do it correctly:
screen.Drawscaledobject( 620, 230, 2.0,2.0, varr.but_off, &hFFFFFF99) 'good
Now it flys!
Kinetics Screensavers
11 REPLIES 11

Romans_I_XVI
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2015
08:05 AM
Re: creepycrawler?
Thanks for this tip. But wait... this "alpha parameter" , are you saying I can colorize my bitmaps?
edit: or do you just mean I can adjust the transparency (alpha)?
edit: or do you just mean I can adjust the transparency (alpha)?

squirreltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2015
08:42 AM
Re: creepycrawler?
"Romans_I_XVI" wrote:
Thanks for this tip. But wait... this "alpha parameter" , are you saying I can colorize my bitmaps?
edit: or do you just mean I can adjust the transparency (alpha)?
Both. The whiter your bitmap is the more it will "absorb" the color
So if your bit map is white - screen.drawobject( x, y, bitmap, &hFF00007d) will produce a red bitmap at roughly 50% transparency.
You can thank EnTerr for this tip.
Kinetics Screensavers

Romans_I_XVI
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2015
09:00 AM
Re: creepycrawler?
This is awesome! I just wish I could get this into a sprite though! I could still do it in a hackish way I suppose, could have a fully transparent sprite for collision handling and then draw this over it. Would I take a performance hit doing that? Or is there a better way of doing it? (I thought it wasn't possible before now so still happy)


Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2015
11:06 AM
Re: creepycrawler?
"squirreltown" wrote:
Wow i thinks i found an actual bug...errr Feature! yea thats it.
OK.
screen.Drawscaledobject( 620, 230, 2, 2, varr.but_off ) 'good
So the scale params are supposed to be floats, natch but the above works.
Until you add the ( i swear i saw it somewhere - recently documented alpha parameter) then it errors with type mismatch
screen.Drawscaledobject( 620, 230, 2, 2, varr.but_off, &hFFFFFF99 ) 'no good
but when you do it correctly:
screen.Drawscaledobject( 620, 230, 2.0,2.0, varr.but_off, &hFFFFFF99) 'good
Now it flys!
Thanks for the bug report. I confirmed the issue.

Romans_I_XVI
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2015
05:44 PM
Re: creepycrawler?
Ok so I am using this to give the appearance of an object fading out in opacity. I thought that the hex constant &h was just a representative of a decimal intiger, as in &hFFFFFFFF = 4294967295 (http://sdkdocs.roku.com/display/sdkdoc/ ... +Reference Section 3.3). Maybe I was completely wrong. Either way 4294967295 gives me a tinted red bitmap where &hFFFFFFFF gives me what I expected.
I might just not be understanding how hex is being used here, but instead I implimented this function for the time being which is working great, it just seems a bit excessive, figured there might be a more efficient way if anyone here is more knowledgable. Thanks.
I might just not be understanding how hex is being used here, but instead I implimented this function for the time being which is working great, it just seems a bit excessive, figured there might be a more efficient way if anyone here is more knowledgable. Thanks.
Function reduce_transparency_hex(hex)
if hex = &hFFFFFFFF
hex = &hFFFFFFEF
return hex
else if hex = &hFFFFFFEF
hex = &hFFFFFFDF
return hex
else if hex = &hFFFFFFDF
hex = &hFFFFFFCF
return hex
else if hex = &hFFFFFFCF
hex = &hFFFFFFBF
return hex
else if hex = &hFFFFFFBF
hex = &hFFFFFFAF
return hex
else if hex = &hFFFFFFAF
hex = &hFFFFFF9F
return hex
else if hex = &hFFFFFF9F
hex = &hFFFFFF8F
return hex
else if hex = &hFFFFFF8F
hex = &hFFFFFF7F
return hex
else if hex = &hFFFFFF7F
hex = &hFFFFFF6F
return hex
else if hex = &hFFFFFF6F
hex = &hFFFFFF5F
return hex
else if hex = &hFFFFFF5F
hex = &hFFFFFF4F
return hex
else if hex = &hFFFFFF4F
hex = &hFFFFFF3F
return hex
else if hex = &hFFFFFF3F
hex = &hFFFFFF2F
return hex
else if hex = &hFFFFFF2F
hex = &hFFFFFF1F
return hex
else if hex = &hFFFFFF1F
hex = &hFFFFFF0F
return hex
else
hex = &hFFFFFF00
return hex
end if
End Function

squirreltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2015
06:34 PM
Re: creepycrawler?
Here are two bitmaps cross fading.
I know you are using the compositor so you might need some adapting.
I know you are using the compositor so you might need some adapting.
for i = 0 to 255
hexcolor = &hFFFFFF00+i
hexcolor2 = &hFFFFFFFF-i
screen.clear(whatev)
screen.drawobject( 0,0, bitmap, hexcolor) 'fading in
screen.drawobject( 0,0, bitmap2, hexcolor2) ' fading out
screen.swapbuffers()
end for
Kinetics Screensavers

Romans_I_XVI
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2015
06:38 PM
Re: creepycrawler?
Lol, so easy... Thanks! Didn't think it would be as simple as subtracting decimal from the hex 😄

Romans_I_XVI
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2015
06:47 PM
Re: creepycrawler?
Worked perfect! Still loling over this. Replaced a call to a 50 line function to ...
😛
color = color - 16
😛

Komag
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2015
04:01 AM
Re: creepycrawler?
I always love when big messy code gets replaced by something elegant and simple 🙂