Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Shadow, blur on objects
Started by jdsmedeirosbr Jan 10 2020 03:28 AM

17 replies to this topic
shadow blur
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

jdsmedeirosbr

[GLOBAL: userInfoPane.html]
jdsmedeirosbr
  • Enthusiast

  • 83 posts
  • Corona SDK

How can I make this shadow effect on a rectangle? I found nothing related to blur or shadow in Corona objects

 

 

Attached Files



[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Corona Geek

  • 1,103 posts
  • Corona SDK

There are a few ways you could approach this.

 

For those kind of shadows, I'd probably create the same display object, like a rect or a rounded rect, "twice" and for the object below, I'd add a bitmap stroke that acts like a shadow.



[TOPIC: post.html]
#3

jdsmedeirosbr

[GLOBAL: userInfoPane.html]
jdsmedeirosbr
  • Enthusiast

  • 83 posts
  • Corona SDK

There are a few ways you could approach this.

 

For those kind of shadows, I'd probably create the same display object, like a rect or a rounded rect, "twice" and for the object below, I'd add a bitmap stroke that acts like a shadow.

 

Is there any Corona function related to bitmap stroke? I didn't find anything in the documentation. Could you explain me about this procedure?



[TOPIC: post.html]
#4

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Corona Geek

  • 1,103 posts
  • Corona SDK

You've got to put in at least some effort. :D

 

If you google "corona bitmap stroke", the first result that you get is https://docs.coronalabs.com/api/type/ShapeObject/stroke.html.



[TOPIC: post.html]
#5

nick_sherman

[GLOBAL: userInfoPane.html]
nick_sherman
  • Corona Geek

  • 1,913 posts
  • Corona SDK

Can you give me a URL for Google? I can't find it.  ;)



[TOPIC: post.html]
#6

Michael Flad

[GLOBAL: userInfoPane.html]
Michael Flad
  • Contributor

  • 247 posts
  • Corona SDK

You could use a gradient fill for the stroke for easy parametrization of shadow color, width etc.

 

Like so

 

local shadow = display.newRoundedRect( 200, 200, 200, 200, 20 )
local paint = {
    type = "gradient",
    color1 = { 0, 0, 0, 0.3 },
    color2 = { 0, 0, 0, 0 },
}
shadow.stroke = paint
shadow.strokeWidth = 50
local rect = display.newRoundedRect( 200, 200, 200, 200, 20 )

  • pixec likes this

[TOPIC: post.html]
#7

jdsmedeirosbr

[GLOBAL: userInfoPane.html]
jdsmedeirosbr
  • Enthusiast

  • 83 posts
  • Corona SDK

Thanks for the response from decent person Michael Flad.

 

Xedur @Spyric and nick_sherman, when I searched google, it was for something i thought i already had a shadow ready property, not an outline you have to put gradient, so don't say what you don't know, imply that someone don't try to search for something on google, do you think you're talking to some insane? It is from these unkind comments that many depart from the Corona community, unfortunately a few who still remain, have the attitude of responding rudely like these.



[TOPIC: post.html]
#8

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Corona Geek

  • 1,103 posts
  • Corona SDK

There are a lot of people who post their questions here instead of first trying to even google them. I assumed that you had not googled the issue since your follow up question was, and I quote: "Is there any Corona function related to bitmap stroke?" Had you googled for it, you'd have found exactly what you had asked of me.

 

Now, if your issue was with something like "how do I use stroke fill to create those shadows?" then I could have understood that you had actually searched for it, or knew of it, but didn't know how to achieve what I had suggested through stroke, which makes this an entirely different matter. Asking to simply "explain about the procedure" once you've said that you couldn't find any documentation on stroke, as your post implies, warranted a link to said documentation and a prompt asking you to google it. How'd you expect us to know you had found the page and didn't understand what I was saying if you told us that you found nothing in the documentation? :D

 

Like you said, we implied that you hadn't made the effort of searching for it, but it's far from insane. If you frequent these forums as much as I do, or help out as many people as I do, then you'll find a lot of posts that could be solved by inserting the topic title to Google straight away. You also made your fair share of assumptions and rude remarks as well.

 

-

Now, Michael's solution gets the same style of outcome as if you used a bitmap fill. If you wish for more control on how strong the shadow is, how it fades out, etc. then you can create an image with a black circle that fades to transparent.


  • pixec likes this

[TOPIC: post.html]
#9

nick_sherman

[GLOBAL: userInfoPane.html]
nick_sherman
  • Corona Geek

  • 1,913 posts
  • Corona SDK

Thanks for the response from decent person Michael Flad.

 

Xedur @Spyric and nick_sherman, when I searched google, it was for something i thought i already had a shadow ready property, not an outline you have to put gradient, so don't say what you don't know, imply that someone don't try to search for something on google, do you think you're talking to some insane? It is from these unkind comments that many depart from the Corona community, unfortunately a few who still remain, have the attitude of responding rudely like these.

 

Insane? Nope, you sound perfectly level-headed and calm to me. Your ability to take a joke is in particular, quite impressive.



[TOPIC: post.html]
#10

jdsmedeirosbr

[GLOBAL: userInfoPane.html]
jdsmedeirosbr
  • Enthusiast

  • 83 posts
  • Corona SDK

Insane? Nope, you sound perfectly level-headed and calm to me. Your ability to take a joke is in particular, quite impressive.

 

Just see Xedur @Spyric, as you can see above, your comment became a reason for us to sarcasm, good that not all of the Corona community are like this, there are much better people than that, jokes and sarcasm, I also see some questions nonsense, but I prefer not to answer instead of making that kind of sarcasm.
 
Still thanks for the "answer".


[TOPIC: post.html]
#11

pixec

[GLOBAL: userInfoPane.html]
pixec
  • Contributor

  • 102 posts
  • Corona SDK

If you are communicating in text then you should always use language and structure that doesnt leave room for interpretation. No one else knows what you are thinking when you post something, they only know what they read. In text there is also no room for tone and such so it is much harder


@op - your followup post does read like you hadnt found anything but as it is easy to find it would lead to believe you had not searched at all. You were much ruder than needed when the responses were clearly a result of your poor choice of words and not properly explaining your thoughts but expecting everyone to know what you’ve done without writing them down. but I agree that @nick sherman’s joke was not good either

[TOPIC: post.html]
#12

jdsmedeirosbr

[GLOBAL: userInfoPane.html]
jdsmedeirosbr
  • Enthusiast

  • 83 posts
  • Corona SDK

If you are communicating in text then you should always use language and structure that doesnt leave room for interpretation. No one else knows what you are thinking when you post something, they only know what they read. In text there is also no room for tone and such so it is much harder


@op - your followup post does read like you hadnt found anything but as it is easy to find it would lead to believe you had not searched at all. You were much ruder than needed when the responses were clearly a result of your poor choice of words and not properly explaining your thoughts but expecting everyone to know what you’ve done without writing them down. but I agree that @nick sherman’s joke was not good either

 

I agree in parts with you, anyone can think and interpret as they want a text, but that does not give the right to make fun of questions from someone who needs something, whether a lazy or not, if you think the question is someone lazy don't even respond instead of being ignorant.
A good example was Michael Flad, who found the question lazy or not, answered decently.
 
Anyway, I close my questions here.


[TOPIC: post.html]
#13

nick_sherman

[GLOBAL: userInfoPane.html]
nick_sherman
  • Corona Geek

  • 1,913 posts
  • Corona SDK

 

Just see Xedur @Spyric, as you can see above, your comment became a reason for us to sarcasm, good that not all of the Corona community are like this, there are much better people than that, jokes and sarcasm, I also see some questions nonsense, but I prefer not to answer instead of making that kind of sarcasm.
 
Still thanks for the "answer".

 

 

I agree, I've been an absolutely awful member of the Corona community for the past 9 years, helping people for no other reason than to pay forward the help I got when I first started. Looking forward to your invaluable contribution over the coming decade. 



[TOPIC: post.html]
#14

jdsmedeirosbr

[GLOBAL: userInfoPane.html]
jdsmedeirosbr
  • Enthusiast

  • 83 posts
  • Corona SDK

I agree, I've been an absolutely awful member of the Corona community for the past 9 years, helping people for no other reason than to pay forward the help I got when I first started. Looking forward to your invaluable contribution over the coming decade. 

 

No one here said anything about you not being a Corona contributor, you may not even be an arrogant person, but with me you were and are being now too, because neither I nor anyone needs to contribute 9 years with something to justify the quality of helping, Sometimes even a beginner helps in a beneficial way! keep asking others what they did to compare with you? it's ridiculous..
So lower your ego, it is very high.


[TOPIC: post.html]
#15

pixec

[GLOBAL: userInfoPane.html]
pixec
  • Contributor

  • 102 posts
  • Corona SDK

this continued fighting wont really help anyone but I want to give one piece of advice:

You usually get back what you put in. @op asked a poor quality question and received equal responses, then @op didnt clarify himself or accept that but instead started acting rude and then got more rudeness back

If people dont want lazy, rude or even joke responses to their posts, then dont make lazy or rude posts. If you get one reply like that, then correct your post or ignore the reply and move on

[TOPIC: post.html]
#16

nick_sherman

[GLOBAL: userInfoPane.html]
nick_sherman
  • Corona Geek

  • 1,913 posts
  • Corona SDK

Agreed. Arguing on the internet, is after all, the most pointless thing since "How to learn French", was translated into French.


  • pixec likes this

[TOPIC: post.html]
#17

jdsmedeirosbr

[GLOBAL: userInfoPane.html]
jdsmedeirosbr
  • Enthusiast

  • 83 posts
  • Corona SDK

this continued fighting wont really help anyone but I want to give one piece of advice:

You usually get back what you put in. @op asked a poor quality question and received equal responses, then @op didnt clarify himself or accept that but instead started acting rude and then got more rudeness back

If people dont want lazy, rude or even joke responses to their posts, then dont make lazy or rude posts. If you get one reply like that, then correct your post or ignore the reply and move on

 

No one is fighting here, but I disagree with you on this point. Does asking yourself something that someone else thinks is a lazy question entitle you to rudely answer? Is that really what you said? If in this forum you follow this thought, Corona is doomed to failure, because no one needs rude answers, Michael Flad has proved it.
 
And my question has already been solved, thank you all.


[TOPIC: post.html]
#18

nick_sherman

[GLOBAL: userInfoPane.html]
nick_sherman
  • Corona Geek

  • 1,913 posts
  • Corona SDK

Well, Corona is doomed to failure because there's by all indications two staff members left, they don't do any marketing and there is no business model to speak of. Over the past 9 years I believe they've had around $600 from me, as someone who has used it virtually every day in a professional capacity. So if they're not making money from that type of user, where are they? 

 

Unfortunately we've had to read thousands of posts over the years where the person has made absolutely no effort to figure things out for themselves, wanting us to basically program their game from start to finish, so our patience with posts that may appear to be in the same vein can be lower than you might hope. 


  • pixec likes this


[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: shadow, blur