Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 6 posts ] 
    ZenVirZan
  Tue Apr 24, 2012 3:33 pm
very undead
User avatar
Sponsor

Inept Evil Stooge

Location: land of the snags 'n tracky-dacks
Hi guys,
I've recently left RPGMaker and started developing in Rubygame; however, I keep running into problems.



Issue #1
libfreetype-6 has the strangest behaviour when outside of system32. I've specified SDL_PATHS yet it will only ever work if in the same folder as the initial .rb.



Issue #2
I cannot draw on any surfaces. Say I do this (already required and included):
Expand to see the code.

It always crashes and says that the method 'load' is private.
wtf.



Issue #3
I create a sprite in a new class called Character:
Expand to see the code.

And it keeps saying 'Failed loading libpng' and that the module couldn't be found. (SDLError)
Am I dong something wrong?

Please help, because I cant find information on these errors anywhere!

_________________
Image


Top Top
Profile      
 

    ZenVirZan
  Tue Apr 24, 2012 4:40 pm
very undead
User avatar
Sponsor

Inept Evil Stooge

Location: land of the snags 'n tracky-dacks
I fixed issue #2 and #3
But i'm still puzzled as to why those .dlls need to be in the __FILE__ folder.

_________________
Image


Top Top
Profile      
 

    ZenVirZan
  Sat Apr 28, 2012 1:02 pm
very undead
User avatar
Sponsor

Inept Evil Stooge

Location: land of the snags 'n tracky-dacks
My project is actually coming along really well now. I'm surprised how much I prefer Rubygame over RGSS, actually!
There's just one thing I can't work out for the life of me, though.
I managed to work around the other issues, however, does anyone know how to use Surfaces and .blit well?
Because I could use a hand xD
In short, I can't 'blit' any sort of image with a transparency onto the screen, without the outer edges going black (but it sometimes works???)

Here, for example, i was making a method of drawing better text (@font is a has containing different TTF instances):
Expand to see the code.


When I call '@text = draw_text('ubuntu,16','Armor',[255,255,255])
And then: '@text.blit $screen,@text.make_rect'

It does draw the text, but:
1. Each time the image is blitted overwrites the previous surface (so it doesnt show any of the black outline)
2. The white text is surrounded by a black square.

I've read the documentation over many times, and I can draw other things to the screen with ease.
For example, going:
Expand to see the code.

Works fine :\
Please help, if you can!

_________________
Image


Top Top
Profile      
 

    Brewmeister
  Sat Apr 28, 2012 2:37 pm
Paste above Main
User avatar


lv 99 Balance Wizard

Location: 42.655713 N 82.619282 W
I don't use RubyGame, but I see a few questionable things....

Shouldn't text2.blit(surface,rect1) be drawn last?

If you're drawing text2 to rect1, you don't need to draw text1 to rect1. (redundant, but not harmful)

I assume you have an underlying image on $screen. Are you refreshing $screen each time you draw (blit) new @text?

Quote:
1. Each time the image is blitted overwrites the previous surface (so it doesnt show any of the black outline)


That is how .blit works. once you /paste/ the new pixels, the old pixels are gone.

Quote:
2. The white text is surrounded by a black square.


Sounds like you are not transferring a fully transparent block. Try drawing just text1 in one position.
Also check the SRCALPHA flag on the surface being returned from your method. (I didn't see a default. I would assume ON, but you never know.)

Good Luck

_________________
"Of course that's just my opinion. I could be wrong!"


Image


Top Top
Profile      
 

    ZenVirZan
  Sun Apr 29, 2012 1:44 pm
very undead
User avatar
Sponsor

Inept Evil Stooge

Location: land of the snags 'n tracky-dacks
Thanks for taking the time to reply, Brew :D

What I'm trying to do, is make a shadow for the text, and then put colored text on top.
So I start with rendering the text to an image (with alpha enabled), and then I blit it onto a canvas repeatedy with adjusted x and y axis to make it wider than the text itself. Whats happening is that when I blit an image onto the canvas (canvas has SRCALPHA enabled), it erases whats underneath. I don't understand how, because both surfaces have alpha enabled, and yet it overwrites the previous canvas's pixels each time.
I can blit just the image (the rendered text on their own) without putting it onto the canvas to the screen, and it works fine, but going image -> canvas -> screen just doesn't work. So I figure there's something wrong with how I'm blitting to my canvas, or my canvas in general.

I tried changing the canvas to SRCALPHA as you said, but it still drew the box. Infact, I made the canvas SRCALPHA and changed the dimensions to the same as the screen, left it blank and blitted it to the screen, and the screen went black.
So there's something wrong with my canvas.

Currently my canvas is made with:

@canvas = Surface.new [$screen.w,$screen.h],0,[HWSURFACE,SRCALPHA]

_________________
Image


Top Top
Profile      
 

    Brewmeister
  Sun Apr 29, 2012 2:57 pm
Paste above Main
User avatar


lv 99 Balance Wizard

Location: 42.655713 N 82.619282 W
Maybe if both surfaces have alpha, the transparent transfers from one to the other??? (replaces all pixels, even the alpha ones)
Did you try setting the target's alpha to off, and the sources to on?

Just spit-balling. in RGSS, I've done it the same way, but the draw_text method is already there. (so you don't use .blt)
i.e., instead of .blt, just draw(render) the text 5 times to the same bitmap.

_________________
"Of course that's just my opinion. I could be wrong!"


Image


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 


Who is online

Users browsing this forum: No users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group